PublishForm Method

Applies To

FormDescription object.

Description

Saves the definition of the FormDescription object in the specified form registry. Forms are registered as one of three classes: Folder, Organization, or Personal. The Folder form registry holds a set of forms that are only accessible from that specific folder, whether public or private. The Organization form registry holds forms that are shared across an entire enterprise and thus are accessible to everyone. The Personal form registry holds forms that are accessible only to the current store user.

Syntax

expression.PublishForm(Registry, Folder)

expression An expression that returns a FormDescription object.

Registry Required Long. The form class. Can be one of the following OlFormRegistry constants: olDefaultRegistry, olFolderRegistry, olOrganizationRegistry, or olPersonalRegistry. Use olDefaultRegistry to handle items without regard to their form class.

Folder Required MAPIFolder. Used only with Folder form registry. The folder object from which the forms must be accessed.

Example

This example creates a contact, obtains its FormDescription object, and saves it in the Folder form registry of the default Contacts folder.

Set myFolder = _
    olNameSpace.GetDefaultFolder(olFolderContacts)
Set myItem = myOlApp.CreateItem(olContactItem)
Set myForm = myItem.FormDescription
myForm.Name = "My Contact"
myForm.PublishForm olFolderRegistry, myFolder
This example creates an appointment, obtains its FormDescription object, and saves it in the user's Personal form registry.

Set myItem = myOlApp.CreateItem(olAppointmentItem)
Set myForm = myItem.FormDescription
myForm.Name = "Interview Scheduler"
myForm.PublishForm olPersonalRegistry