Word VBA: Turning On/Off the Track Change

This Word VBA macro toggles the track change.

Macro Example

Sub ToggleTrackChange()
  
  ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions

End Sub

Description

[Application.]ActiveDocument

  ActiveDocument...

The Application.ActiveDocument property returns an active Document object.

obj-Word-Application-ActiveDocument

And the ActiveDocument property is a member of the Word.Global class, so we can omit the Application property.

obj-Word-ActiveDocument

Document.TrackRevisons

  ActiveDocument.TrackReviions...

The Document.TrackRevisions property returns or sets whether the changes are tracked or not.

obj-Word-Document-TrackRevisions

Not operator

  ActiveDocument.TrackReviions = Not...

The Not operator switches a boolean value to its opposite.

  ActiveDocument.TrackReviions = Not ActiveDocument.TrackReviions

If the Document.TrackReviions property is True, then it will be False.
If the Document.TrackReviions property is False, then it will be True.

Sub ToggleTrackChange()
  
  ActiveDocument.TrackRevisions = Not ActiveDocument.TrackRevisions

End Sub

Properties

http://www.relief.jp/itnote/archives/word-macro-toggle-track-revisions.php

Apply To

  • Word 2013
  • Word 2010
  • Word 2007