Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

AddIn

Note Required applications

The features in this topic are available only if you have the required applications installed.

For more information, see Features Available by Product Combination.

  • One of these development environments:

    VSTO 2005

    -or-

    Visual Studio Team System

    -or-

    Visual Studio 2005 Professional Edition

  • VSTO 2005 SE installed in the development environment

  • Microsoft Office 2003

    -or-

    2007 Microsoft Office system

The Microsoft.Office.Tools.AddIn class is the host item for application-level add-ins that you create by using Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System (VSTO 2005 SE). Use members of the AddIn class to perform basic tasks in your add-in, such as accessing the object model of the host application.

You can also use members of the AddIn class to add advanced functionality to your add-in, such as creating custom task panes and exposing objects to other add-ins. For more information about host items, see Host Items and Host Controls Overview.

Understanding the AddIn and ThisAddIn Classes

The AddIn class represents the add-in. VSTO 2005 SE creates an instance of this class in add-in projects to serve as the communication link between the Microsoft Office application and your code. Because the AddIn object is managed by VSTO 2005 SE, you should not explicitly instantiate this class.

You can access the AddIn class by using the ThisAddIn class in your add-in project. The ThisAddIn class derives from AddIn. The ThisAddIn class provides a location in which you can start writing code in your project. For more information, see Getting Started Programming Application-Level Add-ins.

Members to Use for Various Tasks

You can perform many tasks in your add-in by using members of the ThisAddIn class. The following table describes the most common tasks and the members you can use to perform the tasks.

Task Member to use

Run code when the add-in is loaded.

Add code to the ThisAddIn_Startup method. This method is the default event handler for the Startup event. For more information, see Visual Studio Tools for Office Project Events.

Run code when the add-in is unloaded.

Add code to the ThisAddIn_Shutdown method. This method is the default event handler for the Shutdown event. For more information, see Visual Studio Tools for Office Project Events.

Automate the host application by accessing the object model.

Use the Application field of the ThisAddIn class. For more information, see Office Solutions Programming Model.

Create a custom task pane.

Use the CustomTaskPanes field of the ThisAddIn class. For more information, see Custom Task Panes Overview.

Customize the Ribbon UI.

Override the RequestService method. For more information, see Ribbon Extensibility Overview.

Create Outlook form regions.

Override the RequestService method. For more information, see Outlook Form Regions Overview.

Expose objects in your add-in to other add-ins.

Override the RequestComAddInAutomationService method. For more information, see RequestComAddInAutomationService.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.