Results 1 to 13 of 13
  1. #1
    3 Star Lounger
    Join Date
    Aug 2003
    Location
    Green Bay, Wisconsin, USA
    Posts
    396
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Changing highlight color (Word 2002)

    I've had a request to help change the highlighting in some large documents. The editors used gray to highlight parts of the 200-page documents. The gray color doesn't look good when the document is printed then photocopied. They want to change the highlight color to yellow.

    I searched the lounge for an answer and came close with post 244,980, but since I know very little about VBA coding, I have been unable to change the code to work as a macro. Can anyone help a poor help desk person?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing highlight color (Word 2002)

    You don't need VBA for this, fortunately. Try the following:
    - First, make a backup copy of the document for safety.
    - Click on the little dropdown arrow next to the Highlight button on the toolbar.
    - Select the color you want.
    - Press Esc to deactivate the highlighter.
    - Select Edit | Replace (or press Ctrl+H)
    - Click the More button
    - With the insertion point in the 'Find what' box., click Format and select Highlight.
    - With the insertion point in the 'Replace with' box., click Format and select Highlight.
    - Click 'Find Next', then 'Replace'.
    - If it works as expected, you can click 'Replace All'.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2003
    Location
    Green Bay, Wisconsin, USA
    Posts
    396
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    Thanks, Hans. That was way too easy. I thought we tried that before, but we didn't select the new highlight color, so thought that it didn't work.

  4. #4
    3 Star Lounger
    Join Date
    Aug 2003
    Location
    Green Bay, Wisconsin, USA
    Posts
    396
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    Like most projects it isn't always that easy.

    The find and replace works great, but now the standard yellow highlight is still too dark when the document is printed and copied. Is there anyway to change the highlight colors used in the highlight dropdown list or another easy way to change the highlight color to a lighter shade?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing highlight color (Word 2002)

    The highlight colors are not customizable. You can use shading from the Shading tab of the Borders and Shading dialog instead - you can use specify any color there. (Highlighting is mostly meant for documents that are to be viewed on-screen only.)

  6. #6
    3 Star Lounger
    Join Date
    Aug 2003
    Location
    Green Bay, Wisconsin, USA
    Posts
    396
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    Thanks, Hans, that's what I was afraid of.

    How could I change the current yellow highlights to Shading is a 15% gray? Please remember that I don't know much about VBA. I know how to get code into VBA by using copy and paste.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing highlight color (Word 2002)

    Here is a macro to change all highlighting to 15% gray shading:

    Sub ChangeHighlight2Shading()
    Application.ScreenUpdating = False
    Selection.HomeKey Unit:=wdStory
    With Selection.Find
    .ClearFormatting
    .Highlight = True
    .Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    Do While .Execute
    Selection.Range.HighlightColorIndex = wdNoHighlight
    With Selection.Font.Shading
    .Texture = wdTextureNone
    .ForegroundPatternColor = wdColorAutomatic
    .BackgroundPatternColor = wdColorGray15
    End With
    Selection.Collapse Direction:=wdCollapseEnd
    Loop
    End With
    Application.ScreenUpdating = True
    End Sub

  8. #8
    3 Star Lounger
    Join Date
    Aug 2003
    Location
    Green Bay, Wisconsin, USA
    Posts
    396
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    Thanks, Hans, this macro works great. I'll see if I can learn from the macro a little more about VBA.

  9. #9
    Lounger
    Join Date
    Apr 2003
    Location
    Salt Lake City, Utah, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    This macro is great! I have an add-on question, though. Let's say I've got this macro that finds certain words and highlights them in pink. Now I want to run another macro and highlight certain other words in green, but still retain the pink ones. Can this be done?

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing highlight color (Word 2002)

    Sure, but that has little to do with the macro I posted last September. That macro replaces existing highlights with shading. It doesn't find specific words and highlight them. If you already have a macro that does the latter, you can easily duplicate it and modify it to highlight other words in a different color. There is no reason why that should interfere with the original highlighting.

    If you would like more help, please provide more detailed and specific information.

  11. #11
    Lounger
    Join Date
    Apr 2003
    Location
    Salt Lake City, Utah, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    I'm probably taking a convoluted approach to what I want to do.

    Basically, I have a handful of macros I've created that highlight different things. One highlights first-person words (I, me, we, etc.) and another highlights forms of the verb to be. When someone runs both macros, it highlights everything in whatever their highlighter is set to. What I want to do is highlight the first-person words in one color (pink, for example) and the verb forms in another color (such as green). In addition, other macros highlight other things to bring to a reader's attention. So I was hoping I could "color code" the different macros so the reader could know why it was highlighted. This is all on-screen only, not for print.

    I took your suggested macro and added it to the end of one of the macros, changing whatever it highlighted to pink, but it has the undesired effect of changing EVERYTHING to pink.

    See where I'm going here? :-)

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Changing highlight color (Word 2002)

    I would explicitly set a highlight color in the macros, instead of using the current highlight color. That way, you don't have to tack on code to change the color.

    Example:

    Selection.Range.HighlightColorIndex = wdPink

    or

    Selection.Range.HighlightColorIndex = wdBrightGreen

  13. #13
    Lounger
    Join Date
    Apr 2003
    Location
    Salt Lake City, Utah, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Changing highlight color (Word 2002)

    Wow. Thanks!! That's what I need. You're the best! :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •