Macro to format additions deletions when Comparing Files
I have Word 2010 - Windows 7 64 Bit.
I'm trying to automate my work flow after I've used the compare function in word.
Essentially I want to do 2 things:
1) For all additions I want to highlight the words with:
Selection.Range.HighlightColorIndex = wdGray25
2) For all deletions I want to strike-through the words:
Selection.Font.StrikeThrough = wdToggle
Thank you for your assistance.
For posterity: This worked:
Sub CompareChanges()
'
'
' Deals with Deleted Changes
Number = ActiveDocument.Revisions.Count
For x = 1 To Number
Set myRev = ActiveDocument.Revisions(x).Range
This = ActiveDocument.Revisions(x).Type
If This = 2 Then
myRev.Font.StrikeThrough = wdToggle
End If
Next x
' Deals with Inserted Changes
For Y = 1 To Number
Set myRev = ActiveDocument.Revisions(Y).Range
That = ActiveDocument.Revisions(Y).Type
If That = 1 Then
myRev.HighlightColorIndex = wdGray25
End If
Next Y
End Sub
Last edited by Alphacsulb; 08-19-2013 at 03:43 PM.
Reason: Found the answer in another question.
|