Skip to content

Instantly share code, notes, and snippets.

@pa-0
Forked from githubyouser/Track2Formatting.bas
Created May 22, 2025 00:57
Show Gist options
  • Save pa-0/2272958eb1e28231425746426fb97ba1 to your computer and use it in GitHub Desktop.
Save pa-0/2272958eb1e28231425746426fb97ba1 to your computer and use it in GitHub Desktop.
Convert Tracked Changes in MS Word to Formatted Text
'Source: https://answers.microsoft.com/en-us/msoffice/forum/all/word-2013-is-there-a-way-to-replace-tracked/adc5f04e-34d5-4423-b0ac-84d5548246be
Sub ConvertTrackedChangesToFormatting()
'Add undo function - https://docs.microsoft.com/en-us/office/vba/word/Concepts/Working-with-Word/working-with-the-undorecord-object
Dim objUndo As UndoRecord
Set objUndo = Application.UndoRecord
'Begin the custom undo record and provide a name for the record
objUndo.StartCustomRecord ("Convert Tracked Ch. to Formatting")
Dim arev As Revision
For Each arev In ActiveDocument.Revisions
With arev
If .Type = wdRevisionDelete Then
With .Range.Font
.ColorIndex = wdRed
.StrikeThrough = True
End With
.Reject
ElseIf .Type = wdRevisionInsert Then
With .Range.Font
.ColorIndex = wdRed
End With
.Accept
End If
End With
Next
'End the custom undo record
objUndo.EndCustomRecord
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment