I
ivanov.ivaylo
Hi guys,
I have this macro:
Sub Duplicates()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "am. " {this is 'am.' plus a space}
.Replacement.Text = "amer. " {this is 'amer.' plus a space}
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Font.Italic = True
.MatchCase = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Unfortunately, it replaces such instances: "bbbbbbbam. " (-->
"bbbbbbbamer. ")
I want to to replace only instances where "am. " is an independent
phrase, not part of other phrases.
Regards,
Ivaylo
I have this macro:
Sub Duplicates()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "am. " {this is 'am.' plus a space}
.Replacement.Text = "amer. " {this is 'amer.' plus a space}
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Font.Italic = True
.MatchCase = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Unfortunately, it replaces such instances: "bbbbbbbam. " (-->
"bbbbbbbamer. ")
I want to to replace only instances where "am. " is an independent
phrase, not part of other phrases.
Regards,
Ivaylo