Microsoft.Office.Tools.Word ...


Visual Studio Tools for Office API Reference
Document Class (2007 System)

Represents a document in Visual Studio Tools for Office projects for Microsoft Office Word.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax

Visual Basic (Declaration)
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public Class Document _
    Inherits EntryPointBindableComponentBase _
    Implements IActivatable, IServiceProviderCallback, IOfficeHostItemEntryPoint, IEntryPoint,  _
    ISupportInitializeControl, ISupportInitialize
Visual Basic (Usage)
Dim instance As Document
C#
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public class Document : EntryPointBindableComponentBase, IActivatable, 
    IServiceProviderCallback, IOfficeHostItemEntryPoint, IEntryPoint, ISupportInitializeControl, ISupportInitialize
Remarks

The Microsoft.Office.Tools.Word..::.Document class is the base class for document host items in Visual Studio Tools for Office projects. The Microsoft.Office.Tools.Word..::.Document class provides the same members as the Microsoft.Office.Interop.Word..::.Document class in the Word primary interop assembly, but it adds the following features:

For more information about the role the Microsoft.Office.Tools.Word..::.Document class plays in Visual Studio Tools for Office projects, see Host Items and Host Controls Overview and Document Host Item.

Creating Document Host Items

In application-level projects created by using Visual Studio 2008 Service Pack 1 (SP1), you can create Microsoft.Office.Tools.Word..::.Document objects programmatically by using the GetVstoObject method of any Microsoft.Office.Interop.Word..::.Document object. For more information, see Extending Word Documents and Excel Workbooks in Application-Level Add-ins at Run Time.

In document-level projects, you cannot create a Microsoft.Office.Tools.Word..::.Document object programmatically. Instead, use the ThisDocument class to programmatically access the document in your project. Visual Studio generates this class in your project at design time. The ThisDocument class derives from the Microsoft.Office.Tools.Word..::.Document class, and it is instantiated automatically by the Visual Studio Tools for Office runtime when the end user opens the document. For more information, see Programming Document-Level Customizations.

Inheritance Hierarchy

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Reference

Other Resources

Tags :


Page view tracker