When you create a new application-level project for Word by using Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System (VSTO 2005 SE), Visual Studio automatically creates a ThisAddIn.vb or ThisAddIn.cs code file. You can access the Application object by using Me.Application or this.Application.
When you create a new document-level project for Word by using VSTO 2005, you have the option of creating a new Word Application or Word Template project. VSTO 2005 automatically creates a ThisDocument.vb or ThisDocument.cs code file in your new Word project for both Document and Template projects. You can access the Application and Document objects by using the Me or this object reference.
At first glance, there appears to be a lot of overlap in the Word object model. For example, the Document and Selection objects are both members of the Application object, but the Document object is also a member of the Selection object. Both the Document and Selection objects contain Bookmark and Range objects. The overlap exists because there are multiple ways you can access the same type of object. For example, you apply formatting to a Range object; but you may want to access the range of the current selection, a particular paragraph, section or the entire document.
The Application object contains the Document, Selection, Bookmark, and Range objects.
Word provides hundreds of objects with which you can interact. The following sections briefly describe the top-level objects and how they interact with each other. These include:
1. Application object
2. Document object
3. Selection object
4. Range object
5. Bookmark object
No comments:
Post a Comment