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.
In this tutorial:
Required knowledge
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:
- Fredborg, L. (2020) Handle Track Changes in Word with Macros, DocTools. Lene Fredborg, DocTools. Available at: https://www.thedoctools.com/word-macros-tips/word-macros/handle-track-changes-with-macros/ (Accessed: 10 March 2024).