Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi friends, I don't know hoe to use hexadecimal color values in vba and word to change color name

i know this following code only

ActiveDocument.Styles("StyleOne").Font.ColorIndex=wdBlue


i need your valuable advice, how to use hexadecimal color code?

What I have tried:

use hexadecimal color code in vba
Posted

1 solution

Not what you ask for but - I can only find how to set the color using RGB.
I suppose you can find somewhere on the internet to manually convert your hex color: Hex to RGB Color Converter[^]
Or, you can convert hex to RGB programmatically: Excel Vba RGB to Hex,Long - Hex to Rgb,Long - Color Code Conversions[^]

VB
ActiveDocument.Styles("StyleOne").Font.Color = RGB(255, 0, 0)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900