W
wal
Word 2003
The following code (based on the Word MVP site) works to change the
formatting as shown at the ************** lines:
Sub FindReplaceFormatting()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Font.Italic = True **************
.Replacement.Font.Bold = True **************
.MatchCase = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchWholeWord = False
.Execute Replace:=wdReplaceAll
End With
End Sub
But if I replace the ************** lines with, respectively, the
following, nothing happens (shaded text stays wdColorGray30).
.Font.Shading.BackgroundPatternColor = wdColorGray30
.Replacement.Font.Shading.BackgroundPatternColor = wdColorGray80
If I use wdFindAsk for the .Wrap line, the correct number of items in
wdColorGray30 is announced, but the change does not take place. Do I
need to adjust the code? Or does this just not work in Word VBA?
THANKS.
The following code (based on the Word MVP site) works to change the
formatting as shown at the ************** lines:
Sub FindReplaceFormatting()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.Font.Italic = True **************
.Replacement.Font.Bold = True **************
.MatchCase = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchWholeWord = False
.Execute Replace:=wdReplaceAll
End With
End Sub
But if I replace the ************** lines with, respectively, the
following, nothing happens (shaded text stays wdColorGray30).
.Font.Shading.BackgroundPatternColor = wdColorGray30
.Replacement.Font.Shading.BackgroundPatternColor = wdColorGray80
If I use wdFindAsk for the .Wrap line, the correct number of items in
wdColorGray30 is announced, but the change does not take place. Do I
need to adjust the code? Or does this just not work in Word VBA?
THANKS.