J
Joy
What am I doing wrong? Word 2003 on XP SP2.
I want a macro to change all occurances of Piano to be shown in bold and
red. I recorded the macro and it worked at that time. But using the macro
does not work. You can see that the replacement information such as bold
and color is not recorded.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Piano"
.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
I tried
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Piano"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
With Selection.Find.Replacement
.Text = "\1"
.Font.Color = wdBlue
.Font.Bold = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
but that didn't work either.
Why does Word not record this correctly and how can I fix it?
Thank you!
Joy
I want a macro to change all occurances of Piano to be shown in bold and
red. I recorded the macro and it worked at that time. But using the macro
does not work. You can see that the replacement information such as bold
and color is not recorded.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Piano"
.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
I tried
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Piano"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
With Selection.Find.Replacement
.Text = "\1"
.Font.Color = wdBlue
.Font.Bold = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
but that didn't work either.
Why does Word not record this correctly and how can I fix it?
Thank you!
Joy