Document 類別 (2007 系統)

更新:2007 年 11 月

表示 Microsoft Office Word 之 Visual Studio Tools for Office 專案中的文件。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v9.0 (在 Microsoft.Office.Tools.Word.v9.0.dll 中)

語法

<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public Class Document _
    Inherits EntryPointBindableComponentBase _
    Implements IActivatable, IServiceProviderCallback, IOfficeHostItemEntryPoint, IEntryPoint,  _
    ISupportInitializeControl, ISupportInitialize

Dim instance As Document
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public class Document : EntryPointBindableComponentBase, IActivatable, 
    IServiceProviderCallback, IOfficeHostItemEntryPoint, IEntryPoint, ISupportInitializeControl, ISupportInitialize

備註

Microsoft.Office.Tools.Word.Document 類別是 Visual Studio Tools for Office 專案之 Word 文件的「主項目」(Host Item)。Microsoft.Office.Tools.Word.Document 類別提供與 Word 主要 Interop 組件中 Microsoft.Office.Interop.Word.Document 類別相同的成員,但是還加入了下列功能:

  • Controls 屬性。使用這個屬性,在執行階段時將控制項加入至 Word 文件或移除控制項。

  • VstoSmartTags 屬性。使用這個屬性,將智慧標籤加入至文件。

  • 只有在 Word 物件模型之應用程式層級提供的文件層級事件,例如 BeforeCloseBeforeSave。也就是說,在 Word 物件模型中,這些事件是定義於 Microsoft.Office.Interop.Word.Application 類別。

如需詳細資訊,請參閱主項目和主控制項概觀Document 主項目

繼承階層架構

System.Object
  Microsoft.VisualStudio.Tools.Office.RemoteComponent
    Microsoft.VisualStudio.Tools.Office.EntryPointComponentBase
      Microsoft.VisualStudio.Tools.Office.EntryPointBindableComponentBase
        Microsoft.Office.Tools.Word.Document

執行緒安全

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

請參閱

參考

Document 成員

Microsoft.Office.Tools.Word 命名空間

其他資源

主項目和主控制項概觀

Document 主項目

在執行階段將控制項加入至 Office 文件

智慧標籤概觀

在應用程式層級增益集的執行階段中擴充 Word 文件和 Excel 活頁簿