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

Turning Off Display of the Office Clipboard

When I am editing a document, I find it distracting for Word to display the Clipboard task pane at the left of the ...

Discover More

Changing Text Orientation

Word allows you to change the orientation of text contained within certain objects, such as AutoShapes, text boxes, and ...

Discover More

Accessing the Source of a Document Link

If you have information linked into your document, you may want to display the source of that linked information. Word ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Highlighting Every Thousandth Character

Not satisfied with the detail provided by the Word Count feature in Word? Perhaps you want to actually know where every ...

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

Renaming a File

Need to rename a disk file from within a macro? You can do it using the Name command, described in this tip.

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 one less than 9?

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.