G
Guillermo
I want to remove the background color of a range. This must be easy, but I can't get
it working...
<code>
Sub DeleteCorrectionMarks()
Dim TodoElTexto As Range
Set TodoElTexto = ActiveDocument.Range
With TodoElTexto.Find
.ClearFormatting
.MatchWildcards = True
.Format = True
.Font.Underline = wdUnderlineWavy
.Font.UnderlineColor = wdColorRed
With .Replacement
.Text = "^&"
.Font.Underline = wdUnderlineNone
.Font.Shading.BackgroundPatternColor = 'which constant here?
End With
.Execute Replace:=wdReplaceAll
End With
End Sub
</code>
The macro I run before this one formats my text this way:
Code:
<code>
.Font.Shading.BackgroundPatternColor = wdColorYellow
....
With .Font
.Underline = wdUnderlineWavy
.UnderlineColor = wdColorRed
End With
</code>
If I wanted to remove the shading manually, I'd have to pick "No Fill" in the
corresponding Word's dialog box, but I can't figure out a way to do that via VBA. If I
run my macro, only the underline formatting dissappears.
Cheers,
Guillermo
it working...
<code>
Sub DeleteCorrectionMarks()
Dim TodoElTexto As Range
Set TodoElTexto = ActiveDocument.Range
With TodoElTexto.Find
.ClearFormatting
.MatchWildcards = True
.Format = True
.Font.Underline = wdUnderlineWavy
.Font.UnderlineColor = wdColorRed
With .Replacement
.Text = "^&"
.Font.Underline = wdUnderlineNone
.Font.Shading.BackgroundPatternColor = 'which constant here?
End With
.Execute Replace:=wdReplaceAll
End With
End Sub
</code>
The macro I run before this one formats my text this way:
Code:
<code>
.Font.Shading.BackgroundPatternColor = wdColorYellow
....
With .Font
.Underline = wdUnderlineWavy
.UnderlineColor = wdColorRed
End With
</code>
If I wanted to remove the shading manually, I'd have to pick "No Fill" in the
corresponding Word's dialog box, but I can't figure out a way to do that via VBA. If I
run my macro, only the underline formatting dissappears.
Cheers,
Guillermo