AddIn 类 (2007 system)

更新:2007 年 11 月

为 Microsoft Office 应用程序的外接程序提供核心功能。

命名空间:  Microsoft.Office.Tools
程序集:  Microsoft.Office.Tools.Common.v9.0(在 Microsoft.Office.Tools.Common.v9.0.dll 中)

语法

声明
Public Class AddIn _
    Inherits EntryPointBindableComponentBase _
    Implements ISupportInitializeControl, ISupportInitialize, IServiceProviderCallback, IComAddInAutomationServiceProviderCallback
用法
Dim instance As AddIn
public class AddIn : EntryPointBindableComponentBase, ISupportInitializeControl, 
    ISupportInitialize, IServiceProviderCallback, IComAddInAutomationServiceProviderCallback

备注

AddIn 类是使用 Visual Studio Tools for Office 创建的应用程序级外接程序的宿主项。创建外接程序项目时,Visual Studio Tools for Office 会自动创建名为 ThisAddIn 的类,该类派生自 AddIn。ThisAddIn 类提供了编写代码的起始位置。您可以通过使用 ThisAddIn 类的 Application 字段来访问宿主应用程序的对象模型。有关 ThisAddIn 类的更多信息,请参见 应用程序级外接程序编程AddIn 宿主项

若要在加载或卸载外接程序时运行代码,请将代码添加到 ThisAddIn 类的 ThisAddIn_Startup 和 ThisAddIn_Shutdown 方法中。这些方法是 StartupShutdown 事件的默认事件处理程序。有关更多信息,请参见 Visual Studio Tools for Office 项目事件

继承层次结构

System.Object
  Microsoft.VisualStudio.Tools.Office.RemoteComponent
    Microsoft.VisualStudio.Tools.Office.EntryPointComponentBase
      Microsoft.VisualStudio.Tools.Office.EntryPointBindableComponentBase
        Microsoft.Office.Tools.AddIn
          Microsoft.Office.Tools.Outlook.OutlookAddIn

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

另请参见

参考

AddIn 成员

Microsoft.Office.Tools 命名空间

其他资源

应用程序级外接程序编程

AddIn 宿主项

应用程序级外接程序编程入门

Visual Studio Tools for Office 项目事件