Re: Programmatically Update Custom Form Description
From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 07/29/04
- Next message: UKNewbie: "vbscript help/advice"
- Previous message: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- In reply to: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- Next in thread: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- Reply: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Jul 2004 20:26:06 -0400
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.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Reb DeWinter" <RebDeWinter@discussions.microsoft.com> wrote in message
news:356A4038-87DE-4838-B7DF-34B0D541463E@microsoft.com...
> 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)
>
> "Sue Mosher [MVP-Outlook]" wrote:
>
> > In general, you'd do the same thing programmatically, using the
> > FormDefinition.PublishForm method. But of course, we don't know what
changes
> > you have in mind, so it's impossible to say if they can be done.
> >
> > "Reb DeWinter" <RebDeWinter@discussions.microsoft.com> wrote in message
> > news:750DDE37-1424-4452-8522-25DCC246206E@microsoft.com...
> > > Is there a way to programmatically update a custom form description?
> > 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.
> > > --
> > > Thanks and best regards,
> > >
> > > Reb Dewinter
> >
> >
> >
- Next message: UKNewbie: "vbscript help/advice"
- Previous message: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- In reply to: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- Next in thread: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- Reply: Reb DeWinter: "Re: Programmatically Update Custom Form Description"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|