What is the difference between the FormRegionNameAttribute attribute, the FormRegionName property, and the name of the form region item? The goal of this article is explain each name and how to use them when you add an Outlook Form Region item to a Visual Studio Tools for Office Outlook add-in project.
The FormRegionNameAttribute Attribute
To uniquely identify each form region, edit the FormRegionNameAttribute attribute at the top of the form region class. For example:
The FormRegionNameAttribute attribute identifies the form region across all Outlook add-ins. Because Outlook can load more than one add-in and each add-in can contain multiple form regions, you should set this attribute to a unique name to avoid a name collision.
When you add an Outlook Form Region item to the project, Visual Studio Tools for Office automatically sets this attribute to the name of the add-in connected to the form region item name by a dot—for example, OutlookAddIn1.FormRegion1.
Note: The form region item name is this is the name of the form region code file that appears in Solution Explorer. You specify this name in the Add New Item dialog box when you add a new Outlook Form Region item to the project. Visual Studio Tools for Office only uses this name to create the default FormRegionNameAttribute. Changing this name has no effect on the FormRegionNameAttribute name.
What is the FormRegionName Property?
You will see a property listed in the Properties window named FormRegionName. Like the form region item name, this property has no connection with the FormRegionAttribute attribute.
Use the FormRegionName property to specify the label that identifies the form region in the Outlook user interface (UI).
Where this label appears in the Outlook UI depends on which type of form region you create.
For adjoining form regions, this name appears as header text above the form region.
For separate, replacement and replace-all form regions, this name appears as a button in the Show group on the Ribbon of the Outlook item.
Note: This button only appears on the Ribbon of a replacement and replace-all form region if there the item is displaying more than one form region. For example, if two replace-all form regions are associated with the same item, then that item would display a button on the Ribbon for each form region.
When you first create an Outlook form region, you specify the value of the FormRegionName property in the Supply descriptive text and select your display preferences page of the New Outlook Form Region wizard.
- Norm Estabrook
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.