The code below will find and replace all keywords in a selection.
Code:
With Selection.Find
.ClearFormatting
.Text = "keyword"
.Replacement.Text = "replacement_keyword"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
How can I rewrite it so that it will only replace the last keyword in the selection? So, if it happens there are multiple keywords in the text, only the last match should be replaced, while the others before it should not be changed.
Alex