For context, I'm envisioning the following code but with "sample" replaced by code that will refer to whatever has been selected in the document.
Quote:
Selection.Find.Replacement.Highlight = True
With Selection.Find
.Text = "sample"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
|