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: Counting Changed Words.
Written by Allen Wyatt (last updated May 19, 2018)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
Steven uses Track Changes in his documents all the time. He needs a way to count only the words that have been changed in a document—those affected by Track Changes.
The answer is that you can sort of get the information you want through the use of the Reviewing Pane. Display the Review tab of the ribbon, then click the Reviewing Pane tool (in the Tracking group). Word displays the Reviewing Pane on-screen, and at the top of the pane is a summary of the revisions made in the document. It shows statistics for the following five changes:
These statistics may seem to fit the bill, but you'll remember that I said that they provide "sort of" the information wanted. They fall a bit short if what you really want is a count of changed words. The statistics count changes, not changed words. For instance, if you delete a phrase that consists of multiple words, that edit counts as only a single deletion in the statistics. Similarly, if you add a phrase to your document, that addition counts as a single insertion, even if the insertion contained a complete paragraph.
If you want actual words changed, you are unfortunately out of luck—Word provides no way to get the information desired. You can, however, devise your own macro to determine the desired information. Here's an example:
Sub GetTCStats() Dim lInsertsWords As Long Dim lInsertsChar As Long Dim lDeletesWords As Long Dim lDeletesChar As Long Dim sTemp As String Dim oRevision As Revision lInsertsWords = 0 lInsertsChar = 0 lDeletesWords = 0 lDeletesChar = 0 For Each oRevision In ActiveDocument.Revisions Select Case oRevision.Type Case wdRevisionInsert lInsertsChar = lInsertsChar + Len(oRevision.Range.Text) lInsertsWords = lInsertsWords + oRevision.Range.Words.Count Case wdRevisionDelete lDeletesChar = lDeletesChar + Len(oRevision.Range.Text) lDeletesWords = lDeletesWords + oRevision.Range.Words.Count End Select Next oRevision sTemp = "Insertions" & vbCrLf sTemp = sTemp & " Words: " & lInsertsWords & vbCrLf sTemp = sTemp & " Characters: " & lInsertsChar & vbCrLf sTemp = sTemp & "Deletions" & vbCrLf sTemp = sTemp & " Words: " & lDeletesWords & vbCrLf sTemp = sTemp & " Characters: " & lDeletesChar & vbCrLf MsgBox sTemp End Sub
This macro steps through each change in the current document and separately sums word counts and character counts for both insertions and deletions. The statistics are then presented in a message box. Note that the macro looks at the Words collection for each change in the document. You should understand that the word count, as presented here, is an approximation. This is because of the way that words are counted. For instance, each punctuation mark in an addition is counted as a separate word. This means that a phrase such as "as one can see, this is a great way" would be tallied as ten words instead of nine (the comma counts as a separate word). Further, if the phrase you added included a leading space—which insertions often do—then there would be eleven words tallied for the insertion because of that space.
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 (11484) 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: Counting Changed Words.
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!
Track Changes is a great tool for developing documents. If you want to copy text from one document to another, with ...
Discover MoreIf you want to configure how Word displays changes in your document, you may be at a loss as to where to start. This tip ...
Discover MoreEver wonder how to customize the way the Track Changes feature displays revision bars at the side of changed material? ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-01-17 08:04:33
Yann
Brilliant macro. Thank you so much for sharing.
What would be nice to have on top of that would be some sort of %age of document change.
Anyway, thanks for this, very helpful.
2020-11-18 04:45:11
Your TrackChanges Macro is Genius!!!
And it works in Word for Mac V16
2019-07-30 07:05:14
MamthaACD
Hi Allen,
We are JAVA developers and are working on extracting Track changes from Ms Word document, using ASPOSE API.
We encounter problem with number of Track changes doubling when we extract from Ms Word, against the list of track changes which lists on the Review Pane on left side.
We do understand that our API is returning every single change performed by the Reviewer and it will be tracked against Track changes. However, the total Revisions on left pane of the Word document, is less compared to extracted Track changes from API.
For instance, if the user is trying to replace a word 'happening' with 'happened' in a given word document.
Removing 'happening', is tracked as 'DELETION',
While replacing 'happened', if user tries to save accidentally, by just entering part of the word like 'happ', saving the document,
and enters rest of the word 'ened' and saving the document. This row of actions will be considered as seperate Track changes from API.
However, at Review pane, the row of actions are considered as one and shows one 'DELETION' and one 'INSERTION', instead of 2 'INSERTIONS'.
Please clarify.
2018-07-28 08:54:40
Tanya Harvey Ciampi
Dear Allen,
My previous mail was imprecise. Sorry, your brilliant macro DOES work fine (Word 2007) but only on a document that has been revised with Track Changes activated first. The document I had tried it on showed changes highlighted but as a result of an old and a new document being COMPARED in Word. So not quite the same. Do you have another macro that would work in that scenario?
Many thanks.
Best regards,
Tanya
www.multilingual.ch
2018-07-28 08:34:49
Tanya
Dear Allen, Thanks for this very useful macro. However, when I ran it it stopped at the following line: "Select Case oRevision.Type".
Do you have any idea why that may be?
Many thanks.
Best regards,
Tanya
www.multilingual.ch
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 © 2024 Sharon Parq Associates, Inc.
Comments