Working on a mass editing project where I needed to edit a large number of Word documents. I needed to switch Track Changes on for all of the currently open documents.

1. Loop through all open docs

The tutorial Loop through all open Word docs with VBA is our starting point.

' adapted from http://www.vbaexpress.com/kb/getarticle.php?kb_id=136

Sub ShowFullNameOpenDocs()
     
    Dim objDoc As Document
     
    On Error Resume Next
     
    For Each objDoc In Application.Documents
        MsgBox objDoc.FullName, vbOKCancel, "Name of Document is: "
    Next objDoc
     
    Set objDoc = Nothing
     
End Sub

2. Turn Track Changes on

' turn on Track Changes
ActiveDocument.TrackRevisions = True

3. Final

' adapted from http://www.vbaexpress.com/kb/getarticle.php?kb_id=136

Sub ShowFullNameOpenDocs()
     
    Dim objDoc As Document
     
    On Error Resume Next
     
    For Each objDoc In Application.Documents
        ' turn on Track Changes
        ActiveDocument.TrackRevisions = True
    Next objDoc
     
    Set objDoc = Nothing
     
End Sub


References:






By MisterFoxOnline

Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.