Thank you so much.
And do you know how I could transform a "html" color(ex:FF0000) to this
number?
If it isn't directly possible, I'm sure It's possible to transform it in rgb
then in "Word Color" format.
"Jay Freedman" wrote:
Frenchy wrote:
Hi all,
I'm trying to color some text with colors that aren't defined in Word
(ex blue, dark-green,...)
To see how Word handles it I recorded a small macro, I selected a
text and colored It. Here's what It looks like;
Selection.Font.Color = 14897469
I'm trying and trying to create this number from a rgb or html color
but I can't find any function in Word or C# wich convert my colors in
the Word colo format
Any idea?
Hi Frenchy,
Given the R, G, and B values, the formula for the Color number is
((B * 256) + G) * 256 + R
Be sure to do this arithmetic with 16-bit or 32-bit variables (Long data
type in VBA) to prevent overflow.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org