Finding Changes by Editor

Written by Allen Wyatt (last updated January 14, 2023)
This tip applies to Word 97, 2000, and 2002


Subscriber Doris Bell asked if there was a way, in Word 2000, to locate all the changes made by a particular editor in a document that has Track Changes turned on. The quick answer, of course, would be to upgrade to Word 2002, since this capability is available right from the Reviewing toolbar.

Word 97 and Word 2000, however, are a different story--there you only have the capability to view or not view all tracked changes. If desired, you can address the deficiency by creating macros that allow you to search for changes by a specific editor. Start by creating a user form in the VBA Editor, by following these general steps:

  1. Display the VBA Editor by pressing Alt+F11.
  2. Choose UserForm from the Insert menu. A blank user form is displayed in the editor.
  3. Using the Toolbox, place a Label control in the form, near the left side of the form.
  4. In the Properties for the newly placed Label control, change the Caption property to "Author" (without the quotes).
  5. Using the Toolbox, place a ComboBox control just to the right of the label you placed in step 3.
  6. In the Properties for the ComboBox control, change the Name property to "cboAuthor" (without the quotes).
  7. Using the Toolbox, place a CommandButton control on the form. This can be along the bottom edge of the form, or on the right edge; it is up to you.
  8. In the Properties for the CommandButton control, change the Name property to "cmdFindNext" (without the quotes).
  9. In the Properties for the CommandButton control, change the Caption property to "Find" (without the quotes).
  10. Using the Toolbox, place another CommandButton control on the form. This should be either just to the right of the other CommandButton control, or just below it.
  11. In the Properties for the CommandButton control, change the Name property to "cmdExit" (without the quotes).
  12. In the Properties for the CommandButton control, change the Caption property to "Exit" (without the quotes).
  13. Resize your overall form for the desired appearance.

Your form is now complete, and all you need to do is add the programming code that will take advantage of these controls. Make sure you select the entire form, and then press F7 to display the Code window. If there is any code already there (VBA may provide some default code for you), feel free to delete it. Then, place the following code in the Code window:

Private Sub UserForm1_Initialize()
    Dim oRevision As Revision
    Dim bExists As Boolean

    bExists = False

    ' Go to beginning of document
    Selection.HomeKey Unit:=wdStory

    ' Loop through revisions and add authors
    For Each oRevision In ActiveDocument.Revisions
        If Me.cboAuthor.ListCount > 0 Then
            For i = 1 To Me.cboAuthor.ListCount
                If Me.cboAuthor.List(i - 1) = oRevision.Author Then
                    bExists = True
                End If
            Next i

            ' If it doesn't already exist, add the author to list
            If Not bExists Then
                Me.cboAuthor.AddItem oRevision.Author
            End If

            bExists = False
        Else
            ' Add first Author to the list
            Me.cboAuthor.AddItem oRevision.Author
        End If
    Next oRevision
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub cmdFindNext_Click()

    Dim iStart As Integer
    Dim iEnd As Integer
    Dim myRange As Range
    Dim iRevisions As Integer
    Dim iResponse As Integer
    Dim bAuthorFound As Boolean

    ' Collapse the Selection so that we don't include selected text
    Selection.Collapse wdCollapseEnd
    Selection.MoveRight wdCharacter, 2

    ' Get the Range start and end positions
    iStart = Selection.Range.Start
    iEnd = ActiveDocument.Content.End
    Set myRange = ActiveDocument.Range(Start:=iStart, End:=iEnd)

    ' Count total number of revisions within range
    iRevisions = myRange.Revisions.Count

    If iRevisions > 0 Then
        ' Loop through all revisions in the range 
        ' selecting first one found
        For i = 1 To iRevisions
            If myRange.Revisions(i).Author = Me.cboAuthor.Text Then
                myRange.Revisions(i).Range.Select
                bAuthorFound = True
                Exit For
            Else
                bAuthorFound = False
            End If
        Next i
    End If

    If Not bAuthorFound Then
        ' Ask if they would like to start from the beginning
        iResponse = MsgBox("Search from beginning?", vbYesNo, "Find Author")
        If iResponse = vbYes Then
            ' Go to top of document
            Selection.HomeKey Unit:=wdStory
            cmdFindNext_Click
        Else
            ' Exit
            Unload Me
        End If
    End If
End Sub

When you later run your new user form, you are presented with a way to select editors and find the next edit made by that editor. This allows you to find one edit at a time, not to view all the edits by a particular editor (as you can in Word 2002).

There is a different approach you can take. You could use a macro to "pull" all the edits done in a document, and arrange them by editor in a new document. The following macro shows how you can do this sort of thing. The resulting table even indicates the type of edit done in the original document.

Option Explicit

Private Sub ShowAuthorAndRevisions()
    Dim sRevision As String
    Dim oRev As Revision
    Dim oDoc As Document
    Dim oRng As Range

    For Each oRev In ActiveDocument.Revisions
        With oRev
            sRevision = sRevision & .Author & vbTab _
              & .Type & vbTab & .Range.Text & vbCrLf
        End With
    Next oRev

    ' Open a new document
    Set oDoc = Documents.Add
    With oDoc
        .Range.InsertAfter sRevision
        ' Convert the revisions to a table
        .Range.ConvertToTable Separator:=wdSeparateByTabs
        With .Tables(1)
            ' Sort the table by the author (i.e., the first column)
            .Range.Sort
            ' Add a new row to the beginning of the table
            .Range.Rows.Add BeforeRow:=.Range.Rows(1)
            With .Rows(1)
                ' insert column descriptions
                .Cells(1).Range.Text = "Author"
                .Cells(2).Range.Text = "Revision Type"
                .Cells(3).Range.Text = "Revision"
            End With
        End With
        ' insert a paragraph mark above the table
        Selection.SplitTable
        ' Insert a legend to make reading the revision type easier
        .Range.InsertBefore "Revision Type Legend:" & vbCrLf & _
            "No Revision = 0 " & vbCrLf & _
            "Revision Insert = 1 " & vbCrLf & _
            "Revision Delete = 2 " & vbCrLf & _
            "Revision Property = 3 " & vbCrLf & _
            "Revision Paragraph Number = 4 " & vbCrLf & _
            "Revision Display Field = 5 " & vbCrLf & _
            "Revision Reconcile = 6 " & vbCrLf & _
            "Revision Conflict = 7 " & vbCrLf & _
            "Revision Style = 8 " & vbCrLf & _
            "Revision Replace = 9 " & vbCrLf
    End With
End Sub

For each revision in a document, this macro will find the revision's author, type, and text (if any). The macro will then place all the revisions in a table, sort the table by the name of the author, and insert a small legend that describes each revision type.

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 (1303) applies to Microsoft Word 97, 2000, and 2002.

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

Opening a Document as Read-Only

Afraid of messing up an existing document by some changes you are considering? Consider opening the document as ...

Discover More

Inserting Hyperlinks

Connect your worksheets with other workbooks or with the world of the Internet. The ability to add hyperlinks makes this ...

Discover More

Viewing Comments From a Specific Reviewer

If you have multiple editors (or authors) working on the same document, and each of them is adding comments, you may want ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (menu)

Small Red Dots under Addresses

Does your document have all sorts of different colored underlines on it? Tracking down what most of them are can be easy, ...

Discover More

Automatically Saving Versions

The versioning feature in Word can be very handy as you develop your documents. Here's how to set it up so that a new ...

Discover More

Automatic Sound Clips

Want to add some sound to your documents? It's easy. What isn't so easy is configuring a sound clip to play whenever a ...

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 2 + 2?

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 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.