Helmut, thanks for the reply. No matter what value I use, the cell is always
black. Here is the code:
Word.ActiveDocument.Tables(tblIndex).Cell(cellStart,
2).Shading.BackgroundPatternColor = wdColorBlue
I've tried the grays, colors, etc., all with the same effect.
Jim
> Hi Jim,
>
[quoted text clipped - 28 lines]
> Word XP, Win 98
> http://word.mvps.org/
Helmut Weber - 31 Mar 2005 18:35 GMT
Hi Jim,
one more example. Put the cursor in a cell in a Word document,
and step through the following in single step mode in Word-(!)-VBA.
Sub test09887()
Selection.Collapse
Selection.Cells(1).Shading.BackgroundPatternColor = wdColorBlue
ActiveDocument.Undo 1
Selection.Collapse
Selection.Cells(1).Shading.BackgroundPatternColorIndex = wdBlue
ActiveDocument.Undo 1
Selection.Collapse
Though, if you are approaching Word form another application,
and don't use early binding and don't use option explicit
or something similar in the calling application, then whatever
color (or unknown variable you choose), Word will always treat
it as 0 (zero), which is black.
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Jim Boyce - 31 Mar 2005 23:26 GMT
That was it. I was automating Word from Outlook. When I enter a value rather
than use a constant, it works as expected. Thanks for the help!
Jim
> Hi Jim,
> one more example. Put the cursor in a cell in a Word document,
[quoted text clipped - 21 lines]
> Word XP, Win 98
> http://word.mvps.org/
Cindy M -WordMVP- - 31 Mar 2005 18:57 GMT
Hi Jim,
> No matter what value I use, the cell is always
> black. Here is the code:
[quoted text clipped - 3 lines]
>
> I've tried the grays, colors, etc., all with the same effect.
Version of Word? Does your printer support color printing? Or
is it set to print only black-and-white? Are you able to color
shade cells in tables when NOT using VBA?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)