All I did was change the values in a custom combobox control. When I display the form, the changes seem to work, but then they don't appear when I open a new form. Here is a code snipped of how I tried to use the PublishForm procedure:
m_olNameSpace = myOlApp.GetNamespace("MAPI")
ConFolder = m_olNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
ActFolder = m_olNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderJournal)
myContact = CType(ConFolder.Items.Add("IPM.Contact.Test Contact"), Outlook.ContactItem)
'Clear out curent items listed in form field
oldValCount = myContact.GetInspector.ModifiedFormPages("General").controls("Test Field").listcount - 1
Dim k As Integer
For k = 0 To oldValCount
myContact.GetInspector.ModifiedFormPages("General").controls("Test Field").removeitem(0)
Next
'Add Revised List
ValCount = lsvValues.Items.Count - 1
Dim i As Integer
For i = 0 To ValCount
myField = lsvValues.Items.Item(i).Text
myContact.GetInspector.ModifiedFormPages("General").controls("Test Field").additem(myField)
Next
'display item for development purposes
myContact.Display()
myContact.Save()
Dim oFormDesc As Outlook.FormDescription
oFormDesc = myContact.FormDescription
oFormDesc.Name = "Test Contact"
oFormDesc.PublishForm(Outlook.OlFormRegistry.olFolderRegistry, ConFolder)

Signature
Thanks and best regards,
Reb Dewinter
The change you made -- using ItemAdd to fill a list box -- is not
persistent, because you haven't really changed the **design** of the form,
only the runtime UI. To change the design and persist that change, you'd
need to set the control's PossibleValues property. A possibly better
approach is to include code to fill the list box in your form's Item_Open
event.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> All I did was change the values in a custom combobox control. When I display the form, the changes seem to work, but then they don't appear when
I open a new form. Here is a code snipped of how I tried to use the
PublishForm procedure:
> m_olNameSpace = myOlApp.GetNamespace("MAPI")
> ConFolder = m_olNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
[quoted text clipped - 3 lines]
> 'Clear out curent items listed in form field
> oldValCount = myContact.GetInspector.ModifiedFormPages("General").controls("Test
Field").listcount - 1
> Dim k As Integer
> For k = 0 To oldValCount
myContact.GetInspector.ModifiedFormPages("General").controls("Test
Field").removeitem(0)
> Next
>
[quoted text clipped - 3 lines]
> For i = 0 To ValCount
> myField = lsvValues.Items.Item(i).Text
myContact.GetInspector.ModifiedFormPages("General").controls("Test
Field").additem(myField)
> Next
>
[quoted text clipped - 4 lines]
> oFormDesc = myContact.FormDescription
> oFormDesc.Name = "Test Contact"
oFormDesc.PublishForm(Outlook.OlFormRegistry.olFolderRegistry, ConFolder)
> > In general, you'd do the same thing programmatically, using the
> > FormDefinition.PublishForm method. But of course, we don't know what changes
[quoted text clipped - 3 lines]
> > Manually I would just make the changes to the custom form, run the form and
> > then use "Publish Form As" to overwrite the existing form definition.
Reb DeWinter - 29 Jul 2004 02:48 GMT
Thanks, Sue - the PossibleValues field worked and I would never have known about it since it is not in the help documentation!

Signature
Thanks and best regards,
Reb Dewinter
> The change you made -- using ItemAdd to fill a list box -- is not
> persistent, because you haven't really changed the **design** of the form,
[quoted text clipped - 55 lines]
> and
> > > then use "Publish Form As" to overwrite the existing form definition.