Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Define a custom RGB Colour using VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andreas - 14 Mar 2007 10:55 GMT
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
Helmut Weber - 14 Mar 2007 14:59 GMT
Hi Andreas,

BackgroundPatternColor =  RGB (17, 33, 55)

HTH

Signature

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

andreas - 15 Mar 2007 07:00 GMT
On 14 Mrz., 14:59, Helmut Weber
<HelmutWe...@discussions.microsoft.com> wrote:
> Hi Andreas,
>
[quoted text clipped - 7 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000 (german versions)

Hey Helmut,
Thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.