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

Activating a Hyperlink

Excel worksheets allow you to include hyperlinks that lead to resources on the Internet. Here's how to activate those ...

Discover More

Displaying Letter Grades

Grading in schools is often done using numeric values. However, you may want to change those numeric values into letter ...

Discover More

Forcing a Macro to Run when a Worksheet is Recalculated

Normally a macro is only calculated when you specifically tell Excel to calculate it. Some macros need to be calculated ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (menu)

Automatically Running a Macro

Word allows you to create macros that can run at special times, automatically. This tip explains five special macros that ...

Discover More

Intelligible Names for Macros

The names you use for macros can affect what you see when you add those macros to a toolbar. This tip explains how you ...

Discover More

Quickly Dumping Array Contents

If you store information within a variable array, at some point in your macro you may want to get rid of that ...

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 6 - 0?

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.