How to get Word to automatically remove or apply a specific highlight color?

Anonymous
2022-04-17T15:07:13+00:00

Hello,

I'm accessing a public, collaboratively made document that features tons of hideous highliting patterns, and I want to clean it up for personal use. However, it seems Word is only able to automatically change and/or remove the color of the FONT, not the color of the highlight. That is, I can get Word to automatically change all "green fonted" words to "red fonted", or remove just the "green fonted" words, while keeping the other colors:

Before: Lorem ipsum lorem ipsum lorem ipsum rabble rabble rabble

After: Lorem ipsum lorem ipsum lorem ipsum rabble rabble rabble

Before: Lorem ipsum lorem ipsum lorem ipsum rabble rabble rabble

After: Lorem ipsum lorem ipsum lorem ipsum rabble rabble rabble

But what I want to change is the highlight, not the font color. In other words (pun intended), I want Word to automatically find specific highlight colors and either replace or remove those colors. See the picture below because this question form doesn't have the highlight feature:

Is Word able to do this highlight change/removal on its own? Or do I have to use a macro? If so, can anybody please point me to a ready-made macro that does that? Pretty please? Ohpleaseohpleaseohplease? With a cherry on top?

Of course, I'd rather just remove all those highlights because they look hideous. However, highlighting is the way the collaborators used to convey specific information, and what I need is precisely that information, so a simple highlight removal would eliminate that information as well.

Michel

Microsoft 365 and Office | Word | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-04-17T16:02:28+00:00

    Hi!

    I'll try to help you.

    I know this is frustrating, but Unfortunately it is not possible to find a specific reslce. Word is only able to find the highlighted text in a general way.

    All best!

    0 comments No comments
  2. Anonymous
    2022-04-17T17:27:25+00:00

    After you install the following macro, click on any text that has a highlight color you want to remove (that is, change to "No color") and run the macro.

    Sub RemoveOneHighlight() 
    
        Dim HLColor As WdColorIndex 
    
        Dim rg As Range 
    
        HLColor = Selection.Range.HighlightColorIndex 
    
        If HLColor <> wdNoHighlight Then 
    
            Set rg = ActiveDocument.Range 
    
            With rg.Find 
    
                .Highlight = HLColor 
    
                .Wrap = wdFindStop 
    
                While .Execute 
    
                    If rg.HighlightColorIndex = HLColor Then 
    
                        rg.HighlightColorIndex = wdNoHighlight 
    
                    End If 
    
                    rg.Collapse wdCollapseEnd 
    
                Wend 
    
            End With 
    
        Else 
    
            MsgBox "Place the cursor on text that has the highlight to remove." 
    
        End If 
    
    End Sub
    

    It would be possible to write a macro that changes the selected color to any other available highlight color, but that would need a userform to let you choose both colors. There isn't a good way to post a userform in this forum, but post back if you need that kind of macro and I'll put it on my website for download.

    3 people found this answer helpful.
    0 comments No comments