Excelerate2004
Programmer
Hello,
I'm trying to use VBA code via a button click sub procedure in MS word 2000 to highlight text that has just been replaced via a find & replace.
I used a Macro just to see the syntax for highlighted text and got the following:
<code>
Selection.Range.HighlightColorIndex = wdYellow
</code>
However, I want to use it in this context:
<code>
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "M"
.Replacement.Text = "[A/C]"
<i>.HighlightColorIndex = wdYellow</i>
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
</code>
Is this highlighting of recently replaced text possible??
I'm trying to use VBA code via a button click sub procedure in MS word 2000 to highlight text that has just been replaced via a find & replace.
I used a Macro just to see the syntax for highlighted text and got the following:
<code>
Selection.Range.HighlightColorIndex = wdYellow
</code>
However, I want to use it in this context:
<code>
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "M"
.Replacement.Text = "[A/C]"
<i>.HighlightColorIndex = wdYellow</i>
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
</code>
Is this highlighting of recently replaced text possible??