Hello! I have this macro that I made for a project. It searches for a image and rejects TC changes twice. The problem I have with it is that I can't make it stop at the end of the document so it continues looping until it starts rejecting changes in the text as well. Anybody know how to make it stop at the end of the document?
Thank you in advance!
Code:
Sub Huh()
'
' Huh Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Do
With Selection.Find
.Text = "^g"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Range.Revisions.RejectAll
Selection.NextRevision (True)
Selection.Range.Revisions.RejectAll
Selection.NextRevision (True)
Loop
End Sub