Dear
I have a tracker change document(total page is 79) which i want to highlight this via Macro code. the code will be listed below.
Sub HighLightTrackInsertions()
Dim oRev As Revision
Dim blTrack As Boolean
blTrack = ActiveDocument.TrackRevisions
ActiveDocument.TrackRevisions = True
For Each oRev In ActiveDocument.Range.Revisions
If oRev.Type = wdRevisionInsert Then
oRev.Range.HighlightColorIndex = wdGray50
End If
Next
ActiveDocument.TrackRevisions = blTrack
End Sub
Sub HighLightTrackDeletions()
Dim oRev As Revision
Dim blTrack As Boolean
blTrack = ActiveDocument.TrackRevisions
ActiveDocument.TrackRevisions = True
For Each oRev In ActiveDocument.Range.Revisions
If oRev.Type = wdRevisionDelete Then
oRev.Range.HighlightColorIndex = wdGray50
End If
Next
ActiveDocument.TrackRevisions = blTrack
End Sub
Sub Macro1()
'
' Macro1 Macro
'
'
End Sub
Sub Macro2()
'
' Macro2 Macro
'
'
Application.Run MacroName:="HighLightTrackDeletions"
Application.Run MacroName:="HighLightTrackInsertions"
End Sub
When I run this macro, the result is "Run-time error 5852 requested object is not available."
the bug will be highlight on " If oRev.Type = wdRevisionInsert Then".
Could anyone solve this problem?