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. |
|
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 |
|
Run code when the add-in is unloaded. |
Add code to the |
|
Automate the host application by accessing the object model. |
Use the |
|
Create a custom task pane. |
Use the |
|
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. |