Mitch uses Track Changes in his documents quite a bit. He knows how to accept or reject changes. He's wondering, though, if there is a way to accept a complete subset of changes, such as accepting all deletions in the document, without affecting any other tracked changes.
This can be done, but only by using a macro. Fortunately, VBA allows you to access the revisions made in your document, as long as they were made with Track Changes turned on. The following macro steps through each revision and, if it is a deletion, it accepts that revision:
Sub AcceptDeletions() Dim oRev As Revision For Each oRev In ActiveDocument.Revisions If oRev.Type = wdRevisionDelete Then oRev.Accept Next oRev End Sub
Note that there are two key elements in this macro. First, is the value stored in the .Type property. Word actually allows 22 different types of revisions, as detailed in this WordTip. As shown in the example above, the macro checks only to see if the .Type property indicates that the revision is, in fact, a deletion.
The second key element is the .Accept method. This causes the revision to be accepted, but you could just as easily specify the .Reject method, which would cause the revision to be rejected.
Finally, you should note that after running the macro, all deletions will be accepted in the document, but you won't be able to use Ctrl+Z to undo the effects of the macro.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13881) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.
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!
Track Changes is a great tool to use so that you can, well, "track" what changes are made during the development of a ...
Discover MoreEver wonder how to customize the way the Track Changes feature displays revision bars at the side of changed material? ...
Discover MoreWord allows you to view any tracked changes in your documents in a variety of ways. Here's how you can make one of those ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2022 Sharon Parq Associates, Inc.
Comments