The Application Object

While most of your programming with Word components will probably be centered on the Document object and its subobjects, there are times you will need to deal directly with the Application object and other objects that are not subsumed under the Document object. This includes setting global options, displaying some useful dialog boxes, and manipulating windows and panes.

If you are working within Word, the Application object is automatically available and can be accessed by simply using the Application keyword. If you are automating Word from another Office application, then you must create an instance of the Word application and use the reference to it, in this case MyWordApp:

 Dim MyWordApp As Word.Application Set MyWordApp ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.