Word's Object Model

Written by Allen Wyatt (last updated October 26, 2023)
This tip applies to Word 97, 2000, 2002, and 2003


1

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.

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).

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Making Macros Run Faster

Designing a macro to make it run faster.

Discover More

Changing the Format of Existing Dates

There are a myriad of ways in which a date can be formatted--day first, month first, number of digits in the year, etc. ...

Discover More

Improper Index References

When indexing a document, you may get some funny results once in a while. If you get single index entries when you were ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (menu)

Occurrences of a Text String within a Document

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

Finding Long Sentences

For certain types of writing, you may want to make sure that the sentences in your document do not exceed a certain ...

Discover More

Controlling the Bold Text Attribute

When processing a document in a macro, you may need to make some of your text bold. It's easy to do using the Bold ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

2018-10-22 13:26:39

james

Allen,

I could not get the MSDN link above ( http://msdn.microsoft.com/library/en-us/modcore/html/deovrMicrosoftWord2000.asp) to work.
Is there a more up to date place to go?
Best Regards,


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.