Microsoft Office Tutorials and References
In Depth Information
Working with objects and documents
For developing and automating Word 2007 solutions, we have to interact with and
program objects that are provided by the Word object model. The Word object model
can be accessed through the following main objects:
Application object
Document object
Range object
Selection object
Tables collection object
Application object
The Application object represents the Word 2007 application, and is the parent of
all of the other objects. You can use the Application object's properties and methods
to manage the Word 2007 environment.
// To access the Application object
// Here 'methodname' represents the method available in the
application object.
this.Application.methodname
There is a lot of overlap in the Word 2007 object model. The overlap exists because
there are multiple ways in which we can access the same type of object.
Document object
The Document object is one of the members of the Application object and is also
a member of the Selection object. This is one area where an overlap occurs in the
Word 2007 object model. By using the Document object you can manage independent
documents separately in the Word 2007 solution.
// One of the ways to access Document object
// Here 'methodname' represents the method available in the
application object.
this.Application.Documents.methodname
Range object
The Range object is the object that you would use when you want to work with a
range of spaces, borders, and so on, in Microsoft Office Word 2007. The Range object
represents a bordering area in a document. It includes non-printing characters such
as spaces, tab characters, and paragraph marks.
// One of the ways to access Range object
// Here 'methodorobjectname' represents the method available in the
application object
this.Application.ActiveDocument.Range.methodorobjectname
 
Search JabSto ::




Custom Search