Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Examining Tracked Changes in a Macro.

Examining Tracked Changes in a Macro

Written by Allen Wyatt (last updated August 31, 2019)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


If you need to develop a macro to process a document in which changes have been tracked (using the Track Changes feature), you may wonder how you can determine the number of changes in the document and how you can look at each of the changes, programmatically. It isn't that tough to do if you remember that the changes are organized when using the Revisions collection. This means that you can determine the number of changes using this code:

iNumChanges = ActiveDocument.Revisions.Count

Just like any other collection, you can step through each member of the Revisions collection and figure out various information about the changes represented in each particular member. While the details of what properties and methods belong to the Revisions collection is much too voluminous for this tip, you can determine the type of each change by looking at the Type property, in this manner:

vChange = ActiveDocument.Revisions(1).Type

At this point, vChange will be equal to a revision type that Word tracks. The actual number or revision types depend on the version of Word you are using, but these are the potential values and the built-in enumeration names for the revision types:

Value Enumeration
0 wdNoRevision
1 wdRevisionInsert
2 wdRevisionDelete
3 wdRevisionProperty
4 wdRevisionParagraphNumber
5 wdRevisionDisplayField
6 wdRevisionReconcile
7 wdRevisionConflict
8 wdRevisionStyle
9 wdRevisionReplace
10 wdRevisionParagraphProperty
11 wdRevisionTableProperty
12 wdRevisionSectionProperty
13 wdRevisionStyleDefinition
14 wdRevisionMovedFrom
15 wdRevisionMovedTo
16 wdRevisionCellInsertion
17 wdRevisionCellDeletion
18 wdRevisionCellMerge
20 wdRevisionConflictInsert
21 wdRevisionConflictDelete

Additional information can be found in Word's Help system or by searching the Internet for the phrase "revisions collection". Information about the enumerations can be found at this Microsoft site:

https://docs.microsoft.com/en-us/office/vba/api/Word.WdRevisionType

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 (8922) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Examining Tracked Changes in a Macro.

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

Peculiar Font Differences

Have you noticed page layout differences when you open a document on different systems? There are a number of reasons why ...

Discover More

Determining an ANSI Value in a Macro

Need to know the character code used for a particular character? In a macro you can use the Asc function to determine the ...

Discover More

Rounding to Even and Odd Values

Want to round values so they are always even or odd? You can do it quickly and easily by using the EVEN and ODD worksheet ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Producing Cleaner Markup

Sometimes it seems that Word is overly aggressive in what it shows in its markup when you have Track Changes turned on. ...

Discover More

Setting Default Options for Track Changes

The Track changes feature in Word is a great help in editing documents, particularly if you are working with others or ...

Discover More

Counting Changed Words

Track Changes is a handy tool for those who need to see how a document changes over time. If you have a long document ...

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 five less than 6?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu 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.