Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word: Highlight text in Orange?

Status
Not open for further replies.

mattsv

Programmer
May 21, 2005
28
US
Hello,

Here's a teaser of a question. How does one go about highlighting text in a color other than those provided under the Highlight text toolbar icon?

Suppose one wishes to highlight in orange, and orange is not listed as an option.

There's no option to do something like this within the Font menu, either (as there is no place to specify a text background color?)
 
Hi mattsv,

AFAIK you are limited to the 16 options shown but the effect can be achieved by selecting the text and using Format > Borders and Shading > Shading tab.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
WdColor can be one of these SIXTY-ONE WdColor constants.

wdColorGray625
wdColorGray70
wdColorGray80
wdColorGray875
wdColorGray95
wdColorIndigo
wdColorLightBlue
wdColorLightOrange
wdColorLightYellow
wdColorOliveGreen
wdColorPaleBlue
wdColorPlum
wdColorRed
wdColorRose
wdColorSeaGreen
wdColorSkyBlue
wdColorTan
wdColorTeal
wdColorTurquoise
wdColorViolet
wdColorWhite
wdColorYellow
wdColorAqua
wdColorAutomatic
wdColorBlack
wdColorBlue
wdColorBlueGray
wdColorBrightGreen
wdColorBrown
wdColorDarkBlue
wdColorDarkGreen
wdColorDarkRed
wdColorDarkTeal
wdColorDarkYellow
wdColorGold
wdColorGray05
wdColorGray10
wdColorGray125
wdColorGray15
wdColorGray20
wdColorGray25
wdColorGray30
wdColorGray35
wdColorGray375
wdColorGray40
wdColorGray45
wdColorGray50
wdColorGray55
wdColorGray60
wdColorGray65
wdColorGray75
wdColorGray85
wdColorGray90
wdColorGreen
wdColorLavender
wdColorLightGreen
wdColorLightTurquoise
wdColorLime
wdColorOrange
wdColorPink


EXAMPLE:
Code:
Selection.Font.Color = wdLightOrange

OR, you can use direct RGB index.

EXAMPLE:
Code:
Dim myRGB
 myRGB = RGB(170, 170, 170)
Selection.Font.Color = myRGB

Gerry
See my Paintings and Sculpture
 
Hi Gerry,

Yes, a font can be any colour but highlighting uses a ColorIndex value, not a Color, and that is limited to the following values:

wdNoHighlight
wdBlack
wdBlue
wdBrightGreen
wdDarkBlue
wdDarkRed
wdDarkYellow
wdGray25
wdGray50
wdGreen
wdPink
wdRed
wdTeal
wdTurquoise
wdViolet
wdWhite
wdYellow

Just don't ask why [smile]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
What is the difference between having text a particular color (Font) and highlighting it the same color? Yes, I know there IS a difference, but in practical terms of creating a distinquishing(i.e visual) efect, there is substantively no difference.

Whilst it is true, that CODE wise, you are limited to the smaller number of constants (and interstingly you can not use wdByAuhor on the Font object) when setting parameters for HighlightColorIndex, if the reason is to make specific text a specific color, why NOT use Font? You can just as easily do a search for color on the Font object, as to search for HighlightColorIndex.

What are the requirements???

Gerry
See my Paintings and Sculpture
 

It does seem rather odd all round - never mind the font colour, what is the difference between shading text yellow and highlighting it yellow? Nothing visible AFAICT. Highlighted text does retain its shading when the highlighting is removed - gosh, that's useful.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Guys,

Thanks for your help. I just thought it was kind of strange to have something take up space on my screen as a GUI object (namely the Highlight Icon) and not have more than a limited array of colors.

I figured a color wheel or something would have make sense to exist. I mean, some people highlight in bizarre colors- like orange!

Oh well. Hope this helps someone.
 
Just to simplify above shading idea: after customise>commands, under all commands the 'Shading color' command icon can be dragged onto the toolbar, works in the same way as 'highlight' but any colour can be set.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top