Define a custom RGB Colour using VBA

A

andreas

I recently wrote below (simple) macro which changes the row colour of
a table from blue to yellow. Is it possible to define a custom colour
such as RGB (17, 33, 55). And if this is possible, how do I have to
rewrite this macro.

Help is appreciated. Thank you very much in advance.

Regards,

Andreas


Sub ChangeShading()

Dim oRw As Row

For Each oRw In ActiveDocument.Tables(1).Rows
If oRw.Cells.Shading.BackgroundPatternColor = wdColorBlue Then
oRw.Cells.Shading.BackgroundPatternColorIndex = wdColorLightYellow
End If
Next
End Sub
 
A

andreas

Hi Andreas,

BackgroundPatternColor = RGB (17, 33, 55)

HTH

--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000 (german versions)

Hey Helmut,
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top