Word VBA Set / Reset TrackRevisons
When you create a macro to do some operations that are not concerned with the content of the document, it is always advisable to do it without track changes. It is also better to turn-off the changes on screen as the deleted text might interfere with the process.
When you turn off the TrackRevisons and ShowRevisions, it is always best to leave them in their old state after the operation.
The following code does exactly the same
Dim bTrackRevFlag As Boolean
Dim bShowRevFlag As Boolean
bTrackRevFlag = ActiveDocument.TrackRevisions
ActiveDocument.TrackRevisions = False
ActiveDocument.ShowRevisions = False
' Do Some Operations
ActiveDocument.TrackRevisions = bTrackRevFlag
ActiveDocument.ShowRevisions = bShowRevFlag
The VBA code for autotagging the document switches off the tracking and resets them to their original position after the TagDocument subroutine is executed