by Allen Wyatt
(last updated June 1, 2017)
As you may be aware, Word is an object-oriented program. Internally, Word keeps track of "objects" in your document, such as paragraphs, styles, sections, etc. These objects can be grouped together in collections, which represent all the related objects of a particular type. For instance, the Paragraphs collection represents all the individual Paragraph objects within a document.
As you are creating macros in VBA, it is a good idea to understand the object model used by Word. This model defines all the objects understood by the program (and to which you have access), as well as the various properties (attributes) and methods (procedures) associated with those objects.
If you want to understand more about Word's object model, there are a few different places you can look. The first is the VBA Help system provided with Word. Unfortunately, the VBA Help file is not automatically installed when you install Word or Office. If you cannot access Help while in the VBA Editor, you will need to again run the Word or Office Setup program and make sure the VBA Help file is installed. When you open the VBA Help file, go the Contents tab, expand "Programming Information," expand "Microsoft Word Visual Basic Reference," click on "Microsoft Word Objects," then click on "Documents." You can also search for the term "Object Model" for the information you need.
You can also find out about the object model through the MSDN Web site. Visit the following Web page:
There are a number of Word developer-oriented books available on the market. Other WordTips subscribers speak well of VBA Developer's Handbook by Ken Getz and Mike Gilbert (Sybex Books, ISBN 0782119514) and Microsoft Office 2000 Visual Basic Programmer's Guide by David Shank, Mark Roberts, and Tamra Myers (Microsoft Press, ISBN 1572319526).
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1622) applies to Microsoft Word 97, 2000, 2002, and 2003.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Want to configure Word to do just what you want it to? You can even go so far as to change the actual way in which Word ...Discover More
You may have a need to find out how many times a certain text string occurs within a document. You can find out manually ...Discover More
The names you use for macros can affect what you see when you add those macros to a toolbar. This tip explains how you can ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.