How to save a custom form in a specified folder?

Y

yannickestrada

Hi I had a custom form that opens automatically from another application. I
would like to save this form in a specified public folder and not in the
client default contact folder.

Here is some code but I can´t get to save in the specified folder.

Set objNameSpace = Application.GetNamespace("MAPI")
Set targetFolder = objNameSpace.Folders("Public Folders").Folders("MyFolder")

Set colItems = targetFolder.Items
colItems.Add

what is missing? I do that in the Item_Write() method.

Thanks.
Yannick
 
S

Sue Mosher [MVP]

First, let's get the terminology straight. A form is a UI/code template.
With a form, you create new items. It is the items that you want to save in
the public folder, not the form, which should be "saved" only once -- not
saved in the usual sense, but published. In your scenario, it should be
published to the Organizational Forms library or to each user's Personal
Forms library.

Now for the meat of the matter. Ideally, the application that creates the
items would do so by calling the Add method on the target folder's Items
collection so that the items are originally created in the desired folder.
If that's not possible, then you can try the techniques demonstrated in the
form at http://www.outlookcode.com/d/forms/saveinfolder.htm. If you
encounter problems with the Close method, make sure your copy of Outlook is
up-to-date with service packs and hotfixes.
 
Y

yannickestrada

Thanks Sue, for understand what I was traing to say, I will use the correct
terminology in the future.

I try the technique that is used in the link you send me, and works fine.
Thanks again.

Regards,
Yannick
 

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