Working with Microsoft Word Objects
In Microsoft® Word, the fundamental working object is a document and everything is part of the document. When you are using VBA to work with Word, a Document object represents an open document, and all Document objects are contained in the Application object's Documents collection. Because each Document object is based on a template, each document has an AttachedTemplate property.
A document is a collection of characters arranged into words, words are arranged into sentences, sentences are arranged into paragraphs, and so on. Therefore, each Document object has a Characters collection, a Words collection, a Sentences collection, and a Paragraphs collection. Furthermore, each document has a Sections collection of one or more sections, and each section has a HeadersFooters collection that contains the headers and footers for the section. In addition, some or all of the text in the document might have certain formatting attributes set, and paragraphs might have built-in or custom styles applied.
In This Section
- Understanding Application-Level Objects
Learn about the Application object and other objects that affect Word. - The Document Object
Create or open documents, and add them to the Documents collection. - Working with Document Content
Work with objects contained in the Document object.
Related Sections
- Working with Office Applications
Take advantage of different objects, collections of objects, properties, methods, and events to build your application. - Working with Microsoft Access Objects
Use Form, Report, and DataAccessPage objects and the controls they contain to format and display data and make it possible to add or edit data in a database. - Working with Microsoft Excel Objects
Use VBA to work with Microsoft® Excel objects, from either within Excel itself or another Office application to gain access to every part of Excel. - Working with Microsoft FrontPage Objects
Create, deploy, modify, and manage Web sites using Microsoft® FrontPage®. - Working with Microsoft Outlook Objects
Create custom Outlook objects and manipulate those objects from within Microsoft® Outlook® or from another application using VBA code from within Outlook or from another Office application by using Automation. - Working with Microsoft PowerPoint Objects
Automate Microsoft® PowerPoint® by using the Application object, from which you can open an existing Presentation object or create a new presentation. - Working with Microsoft Project Objects
Build powerful custom applications easily with the Microsoft® Project object model. - Working with Microsoft Visio Objects
Design, model, and manage complex enterprise-level systems with the sophisticated toolset provided by Microsoft® Visio® products.