Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Word 2011-compatible macro for baking in tracked changes as formatted text, after http://www.wordbanter.com/showthread.php?t=68482
Sub TypeAndStrike()
'
' Converts tracked revisions in the active document into "type and Strike " format."
' It removes all tracked revisions.
'
' written by Chip Orange.
'
Dim chgAdd As Word.Revision
' disable tracked revisions.
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
chgAdd.Range.Font.Color = wdColorRed
If chgAdd.Type = wdRevisionDelete Then
' It's a deletion, so make it strike through and then reject the change (so the text isn't lost).
chgAdd.Range.Font.StrikeThrough = True
chgAdd.Reject
ElseIf chgAdd.Type = wdRevisionInsert Then
' It's an addition, so underline it.
chgAdd.Range.Font.Underline = wdUnderlineSingle
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