In this chapter:
Properties That Return Collections
Spelling-Related Properties and Methods
The Documents Collection
Adding, Opening, and Saving Documents
Protection-Related Properties and Methods
The Name Properties
Additional Members of the Document Object
Children of the Document Object
A Document object represents a Word document. Document objects are kept in the Documents collection, which contains all currently opened documents.
The Documents property of the Application object is global, so we can access the Documents collection simply by writing:
For instance, the code:
displays the number of currently open documents.
Perhaps the most commonly used property of the Application object is the ActiveDocument property, which returns a Document object that represents the currently active Word document.
Figure 12-1 shows the children of the Document object.
Figure 12-1. The Document object
Figure 12-2 shows the children of the Document object that I discuss specifically, either in this chapter and in subsequent chapters. First, however, I take a look at some of the properties and methods of the Document object.
Figure 12-2. Selected children of the Document object