Modifica

Condividi tramite


_FormRegionStartup.GetFormRegionIcon(String, Int32, OlFormRegionIcon) Method

Definition

Obtains an icon image that will be displayed for a particular type of icon for the form region.

public:
 System::Object ^ GetFormRegionIcon(System::String ^ FormRegionName, int LCID, Microsoft::Office::Interop::Outlook::OlFormRegionIcon Icon);
public object GetFormRegionIcon (string FormRegionName, int LCID, Microsoft.Office.Interop.Outlook.OlFormRegionIcon Icon);
Public Function GetFormRegionIcon (FormRegionName As String, LCID As Integer, Icon As OlFormRegionIcon) As Object

Parameters

FormRegionName
String

The name of the form region which is the name used when registering the form region in the Windows registry.

LCID
Int32

The locale ID that identifies the language that Outlook is currently using. This value is used to obtain the localization strings corresponding to this language for the form region.

Icon
OlFormRegionIcon

A constant that identifies the type of icon.

Returns

An Object that is either a byte-array that represents the original bytes of the image file or an IPictureDisp object.

Remarks

This method is intended to be implemented by an add-in and called by Outlook. As part of the FormRegionStartup interface, this method and the GetFormRegionManifest(String, Int32) method provide a mechanism through which an add-in can register a form region and provide Outlook with the XML manifest and the icons for the form region.

If you would like an add-in to provide icons for a form region, specify the ProgID of the add-in when you register the form region in the Windows registry. For more information on registering a form region, see Specifying Form Regions in the Windows RegistryGetFormRegionManifest and the GetFormRegionIcon methods of the FormRegionStartup interface.

In the XML manifest for the form region, under the icons element, specify the value addin for each of the child elements where you would like to use a custom icon. Implement GetFormRegionIcon such that when Outlook passes that type of icon as an argument for Icon, GetFormRegionIcon returns the image of the custom icon. If you want Outlook to display the default icon, implement GetFormRegionIcon such that it returns Nothing (a null reference (Nothing in Visual Basic) in C#) for that type of icon. GetFormRegionIcon should also return Nothing (a null reference (Nothing in Visual Basic) in C#) when Icon is olFormRegionIconDefault.

When Outlook starts, it reads the list of form regions from the Windows registry and caches the data associated with the form regions. If a form region has been registered with a ProgID, Outlook will resort to the corresponding add-in by calling its implementation of GetFormRegionIcon for any icon in the XML manifest that has addin as the value of a child element of the icons element. Note that if you do not specify any ProgID in the Windows registry, Outlook will not call the GetFormRegionManifest and GetFormRegionIcon methods.

Applies to