Skip to content

Instantly share code, notes, and snippets.

@hmartiniano
Created December 5, 2019 19:23
Show Gist options
  • Save hmartiniano/712505f4a931991febe3474d3e8c41a7 to your computer and use it in GitHub Desktop.
Save hmartiniano/712505f4a931991febe3474d3e8c41a7 to your computer and use it in GitHub Desktop.
' Adapted from https://stackoverflow.com/questions/34280088/ms-word-macro-for-converting-track-changes-markup-into-text
Sub TrackChangesToMarkup()
Dim chgAdd As Word.Revision
If ActiveDocument.Revisions.Count = 0 Then
MsgBox "There are no revisions in this document", vbOKOnly
Else
ActiveDocument.TrackRevisions = False
For Each chgAdd In ActiveDocument.Revisions
If chgAdd.Type = wdRevisionDelete Then
chgAdd.Range.Font.StrikeThrough = True
chgAdd.Range.Font.Color = wdColorDarkBlue
chgAdd.Reject
ElseIf chgAdd.Type = wdRevisionInsert Then
chgAdd.Range.Font.Color = wdColorRed
chgAdd.Accept
Else
MsgBox ("Unexpected Change Type Found"), vbOKOnly + vbCritical
chgAdd.Range.Select ' move insertion point
End If
Next chgAdd
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment