Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2004

Tip: Looking for answers? Try searching our database.

Macro to run Custom Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zivd - 20 Aug 2004 23:22 GMT
Does anyone know how to programmically access and run a
custom form (instead of going to Action, New "Form"?  My
form is published in the Public Folders so that everyone
in the organization has access to it.

What I'd really like to do is access and run the form from
Word.  I use Redemption, so I can get around security
prompts.

Thanks!
Sue Mosher [MVP-Outlook] - 20 Aug 2004 23:45 GMT
To create a new instance of a custom form programmatically, use the Add
method on the target folder's Items collection. If it's a message form, you
can use the Drafts folder as the target. If the form is published in a public
folder, you can create items using the form only in that folder.

If the target is a default folder, you can use the
Namespace.GetDefaultFolder method to return it as a MAPIFolder object.
Otherwise, you can use the code at
http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy
and return the MAPIFolder corresponding to a given path string.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com 
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> Does anyone know how to programmically access and run a
> custom form (instead of going to Action, New "Form"?  My
> form is published in the Public Folders so that everyone
> in the organization has access to it.
zivd - 21 Aug 2004 01:30 GMT
Thanks Sue.  That's all fine and dandy.  However, my
version of Outlook VBA does not expand for hints.  So..

Your code works fine to acquire the folder, but that's
where I'm stuck:

For the user to do this by hand, he/she opens Public
Folders, All Folders, then clicks on MyFormName.  Then
Actions, New MyFormName.

I'm totally perplexed how to run the form after getting
its folder.

I used the code you suggested, and it is indeed returning
MyFormName.

Then, you say to use the folder's items collection and
add.  That's where I'm stuck.

So, objFolder.Items.Add(what goes here to access
MyFormName?) (like I said, my version of Outlook is not
expanding anything for hints)

>-----Original Message-----
>To create a new instance of a custom form programmatically, use the Add
[quoted text clipped - 21 lines]
>
>.
ZIVD - 21 Aug 2004 02:04 GMT
I actually found the code elsewhere on your wonderful
website.  Thanks for getting me going.  I just need to
convert it over to Word VBA now somehow.

Thanks.

>-----Original Message-----
>Thanks Sue.  That's all fine and dandy.  However, my
[quoted text clipped - 57 lines]
>>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.