Skip to content

Instantly share code, notes, and snippets.

@tullyhansen
Created April 13, 2015 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tullyhansen/0cd241302ad3714dc71b to your computer and use it in GitHub Desktop.
Save tullyhansen/0cd241302ad3714dc71b to your computer and use it in GitHub Desktop.
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