Re: Programmatically Update Custom Form Description

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Sue Mosher [MVP-Outlook] (suemvp_at_outlookcode.com)
Date: 07/29/04


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


Relevant Pages

  • Re: Programmatically Update Custom Form Description
    ... Microsoft Outlook Programming - Jumpstart for ... "Reb DeWinter" wrote in message ... > Is there a way to programmatically update a custom form description? ...
    (microsoft.public.outlook.program_forms)
  • Re: Programmatically Update Custom Form Description
    ... All I did was change the values in a custom combobox control. ... Microsoft Outlook Programming - Jumpstart for ... > "Reb DeWinter" wrote in message ...
    (microsoft.public.outlook.program_forms)
  • Re: Custom Form Printing
    ... > option, because when the custom form is not open, some of the data is not ... >> their own printing code. ... >>>> If you want to control what prints, write your own code, which can ...
    (microsoft.public.outlook.program_forms)
  • Re: Records in a public folder open with different forms...
    ... Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers ... After the custom form was deleted off the server, it was> put back on with a slightly different name. ... If xyz form doesn't exist at> the server or the client, it defaults to the base form > and not some other custom form assigned to that folder? ...
    (microsoft.public.outlook.program_forms)
  • Re: Address Selected field box does not retain address in custom form.
    ... > address in custom form. ... > the controls on the General page of a custom contact form. ... > different anomalies if those controls are on a different ...
    (microsoft.public.outlook.program_forms)