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.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"yannickestrada" wrote in message
...
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