Introduction to the Word Object Model


Regardless of the approach you choose to integrate your code with Word, you eventually will need to talk to the Word object model to get things done. It is impossible to describe the Word object model completely in this book, but we try to make you familiar with the most important objects in the Word object model and show some of the most frequently used methods, properties, and events on these objects.

The first step in learning the Word object model is getting an idea of the basic structure of the object model hierarchy. Figure 6.15 shows the most critical objects in the Word object model and their hierarchical relationship.

Figure 6.15. The basic hierarchy of the Word object model.


The Application object is used to access application-level settings and options. It also is the root object of the object model and provides access to the other objects in the object model. Figure 6.16 shows some of the object model objects associated with the Application object.

Figure 6.16. Objects associated with Word's Application object.


The Document object represents a Word document. Figure 6.17 shows some of the object model objects associated with the Document object.

Figure 6.17. Objects associated with Word's Document object.


The Range object represents a range of text within a document. Figure 6.18 shows some of the object model objects associated with the Range object.

Figure 6.18. Objects associated with Word's Range object.


The Shape object represents a figure, chart, picture, or other object that is embedded in a Word document. Figure 6.19 shows some of the object model objects associated with the Shape object.

Figure 6.19. Objects associated with Word's Shape object.





Visual Studio Tools for Office(c) Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath
Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath
ISBN: 0321411757
EAN: 2147483647
Year: N/A
Pages: 221

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net