This documentation is archived and is not being maintained.

How to: Access the Outlook Item that Displays the Form Region

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Application-level projects

Microsoft Office version

  • Outlook 2007

For more information, see Features Available by Application and Project Type.

A form region appears when you open an item in Microsoft Office Outlook. You can access the Outlook item in which the form region appears by using the OutlookItem property of the FormRegionControl class.

More than one type of Outlook item can display a form region. You can determine what type of Outlook item is displaying the form region and then cast the Outlook item to that type.

The following example identifies the Outlook item as a mail item and then adds the subject of the mail item to a label on the form region.

private void FormRegion1_FormRegionShowing
    (object sender, System.EventArgs e)
    if (this.OutlookItem is Outlook.MailItem)
        if (this.OutlookFormRegion.FormRegionMode == 
            Outlook.MailItem mailItem = 
            label1.Text = "This form region contains information " +
            "about " + mailItem.Subject;