I have documents with mixture of styles and fonts. I need to replace all Tahoma font based paras with Verdana. The find/replace works (inline sort of) but the macro generated from it doesn't. Any idea how I can do this? The slighly modified code is below:
Code: Select all
Sub replaceTahomaWithVerdana()
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Font.Name = "Tahoma" ' I added this
.Replacement.Text = ""
.Replacement.Font.Name = "Verdana" ' and this line
.Forward = True
.Wrap = wdFindAsk
.Format = True
.matchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub