Condividi tramite


How to: Add a form region to an Outlook Add-in project

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Create a form region to extend a standard or custom Microsoft Office Outlook form by using the New Outlook Form Region wizard. You can create a new form region and design the user interface in Visual Studio, or you can import a form region that was designed in Outlook and add Visual Basic or C# code.

If you have an Outlook form region that you used in another Outlook project, you can reuse it in your current Outlook VSTO Add-in project by using the Add Existing Item dialog box. For more information, see Create Outlook form regions.

Applies to: The information in this topic applies to VSTO Add-in projects for Outlook. For more information, see Features available by Office application and project type.

To add a new form region to an Outlook project

  1. Open or create an Outlook VSTO Add-in project in Visual Studio. For more information, see How to: Create Office projects in Visual Studio.

  2. In Solution Explorer, select the Outlook VSTO Add-in project node.

  3. On the Project menu, click Add New Item.

  4. In the Add New Item dialog box, select Outlook Form Region.

  5. Type a name for the form region in the Name box, and then click Add.

    The NewOutlook Form Region wizard starts.

  6. On the Select how you want to create the form region page, select whether you want to design the form region by dragging managed controls onto a visual designer or import a form region that was designed in Outlook.

    Note

    If you choose to import a form region that was designed in Outlook, then you must specify the location of an Outlook Form Storage (.ofs) file. You cannot add managed controls to a form region that you design in Outlook; you can only add code behind the existing UI. For more information, see Create Outlook form regions.

  7. On the Select the type of form region you want to create page, review the form region types and select one, and then click Next. For more information about form region types, see Create Outlook form regions.

  8. On the Supply descriptive text and select your display preferences page, in the Name box, type a name for the form region. For the replacement and replace-all form region types, the Title and Description boxes are also available.

    For information about where the name, title, and description appear in Outlook when you deploy the form region, see Create Outlook form regions.

  9. Select one or more display modes in which you want the form region to appear.

    All form region types can appear in Inspectors, in compose mode (for creating items) and in read mode (for viewing items). Adjoining, replacement, and replace-all form region types can also appear in the Reading Pane.

  10. Click Next.

  11. On the Identify the message classes that will display this form region page, select standard Outlook message classes or type the names of one or more custom message classes, and then click Finish. For more information, see Associate a form region with an Outlook message class.

See also