Tony
Wed Feb 07 08:09:45 CST 2007
It would be good to get a reply from somebody who knows what they're talking
about. Till then we seem to be stuck with me.
The 24-bit RGB colours of yore occupied the low order 24 bits of a 32-bit
word leaving the high order 8 bits set to zero. Word 2007 has an enhanced
colour model which uses all 32 bits - exactly how it works I don't know but
I think it uses the HSL scheme - and which doesn't map directly to the old
24-bit colours. There ought to be some sort of conversion algorithm which
could be used but it doesn't appear as though one actually is.
The Theme colour used in this case, which looks like white, is actually - I
think - some kind of luminous and/or transparent yellow - in binary it is
11011100 00000000 11111111 11111111. Taken as an RGB value, the high order 8
bits are ignored leaving 00000000 11111111 11111111 which is 'pure' yellow
(wdColorYellow), When converted to a ColorIndex this comes out as wdYellow.
Although one can still set colours to RGB values it would appear that
checking them is no longer viable. I can see this causing some confusion :-)
--
Enjoy,
Tony
"Jay Freedman" <jay.freedman@verizon.net> wrote in message
news:aedis2ls7u51dbfe28v7udl3djef4vrd5v@4ax.com...
> What I observed was that when I apply the "white" block in the font
> color dropdown (leftmost in the row just below "Theme Colors"), the
> VBA statement returns 7. But if I use the More Colors dialog and set a
> custom color of RGB = (255,255,255), then the VBA statement does
> return 8.
>
> There's at least one other oddity in that dropdown. The block in the
> "Standard Colors" row that claims to be blue is actually a greenish
> blue, which the VBA statement says is wdTeal (10) instead of wdBlue
> (2).
>
> --
> Regards,
> Jay Freedman
> Microsoft Word MVP FAQ:
http://word.mvps.org
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.
>
> On Wed, 7 Feb 2007 00:23:26 -0000, "Tony Jollans" <My forename at my
> surname dot com> wrote:
>
>>WdColorIndex can not represent all the possible Font colours and it's only
>>use is when a document is opened in Word 97 (maybe 2000 as well, I forget
>>and am too idle to check at the moment). It should, I believe, be set to
>>the
>>nearest valid colour to the actual colour chosen - are you quite sure you
>>set the colour to white and not something close?
>>
>>--
>>Enjoy,
>>Tony
>>
>>"RobertSeattle" <r2715seattle@gmail.com> wrote in message
>>news:1170805284.808559.153020@k78g2000cwa.googlegroups.com...
>>> Pretty simple repro:
>>> 1. Create some text - change the font color to white via the Word font
>>> 2007 UI
>>> 2. Select the Text
>>> 3. Goto VBA and in the Immediate Windows type ?
>>> Selection.Range.Font.ColorIndex
>>> I'm getting the value of 7 which is the colorindex value wdYellow
>>> instead of 8 - wdWhite.
>>> 4. If I do the very same repro steps in Word 2003 I get 8 - the
>>> expected value.
>>>
>>> It seems like the Font.ColorIndex property "likes" the value 7 for
>>> almost any font color that isn't part of the WdColorIndex set. That
>>> would be fine if 7 was "undefined" but 7 is wdYellow.
>>>
>>> I realize Word 2007 is much more "RGB" dependent but the ColorIndex
>>> still shouldn't be wrong.
>>>