Macro to run Custom Form

Z

zivd

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!
 
S

Sue Mosher [MVP-Outlook]

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
 
Z

zivd

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)
 
Z

ZIVD

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top