AddIn 類別 (2007 系統)

更新:2007 年 11 月

提供 Microsoft Office 應用程式增益集 (Add-In) 的核心功能。

命名空間:  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 類別 (Class) 是使用 Visual Studio Tools for Office 建立之應用程式層級增益集的主項目。當您建立增益集專案時,Visual Studio Tools for Office 會自動建立衍生自 AddIn 的類別,並命名為 ThisAddIn。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

執行緒安全

這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。

請參閱

參考

AddIn 成員

Microsoft.Office.Tools 命名空間

其他資源

應用程式層級增益集程式設計

AddIn 主項目

應用程式層級增益集程式設計入門

Visual Studio Tools for Office 專案事件