How to Convert Texts from Shaded to Highlighted and Vice Versa in Your Word Document

In this article, we will focus on showing you the way to convert texts from shaded to highlighted and vice versa in your Word document.

Before starting our article, it’s necessary to understand the differences between shading and highlighting in Word. As for this, you can refer to one of our previous posts: 5 Methods to Remove Highlighting or Shading in Your Word Document

Following contents tend to offer you several methods to convert texts from shaded to highlighted and vice versa in case different people share different preference over shading and highlighting.     Convert Texts from Shaded to Highlighted and Vice Versa

Method 1: Convert Texts from Shaded to Highlighted via VBA

The approach we are talking aims to convert all shaded texts in a document to highlighted ones. Therefore, the best suggestion is to use a macro.

  1. First and foremost, invoke VBA editor by pressing “Alt+ F11”.
  2. Next click “Normal” project on the left column.
  3. Then click “Insert” tab on the menu bar.
  4. Choose “Module” there.Click "Normal"->Click "Insert"->Click "Module"
  5. Open the new module by double click and paste codes there:
Sub ConvertTextsFromShadedToHighlighted()
  Dim objParagraph As Paragraph
  Dim objCharacterRange As Range
 
  For Each objParagraph In ActiveDocument.Paragraphs
    If objParagraph.Range.Information(wdWithInTable) = False Then
      If objParagraph.Range.Shading.BackgroundPatternColor <> wdColorAutomatic Then
        objParagraph.Range.Shading.BackgroundPatternColor = wdColorAutomatic
        objParagraph.Range.HighlightColorIndex = wdPink
      End If
    End If
  Next objParagraph
 
  For Each objCharacterRange In ActiveDocument.Characters
    If objCharacterRange.Font.Shading.BackgroundPatternColor <> wdColorAutomatic Then
      objCharacterRange.Font.Shading.BackgroundPatternColor = wdColorAutomatic
      objCharacterRange.HighlightColorIndex = wdPink
    End If
  Next objCharacterRange
End Sub
  1. Last but not the least, click “Run” to get the codes executed.Paste Codes->Click "Run"

Method 2: Convert Texts from Highlighted to Shaded by Using “Find” Feature

Now here is the opposite situation. First, we will make use of the “Find” feature to find all highlighted contents.

  1. To start off, click “Home” tab and then the drop-down button on “Find” command.
  2. Next select “Advanced Find” on that menu.Click "Home"->Click the Drop-down Button->Click "Advanced Find"
  3. Then in “Find and Replace” box, put insertion pointer inside “Find what” box.
  4. Click “More” to bring out more options.
  5. Next click “Format” and select “Highlight”.
  6. And click “Find In” tab.Click "Format"->Click "Highlight"->Click "Find In"->Choose "Main Document"
  7. Choose “Main Document”. You shall see all highlighted texts in current document are in selection now.
  8. Next click on the drop-down button on “Shading” command under “Home” tab.
  9. Choose a desired color for text background.
  10. Then click on drop-down button on “Text Highlight Color” command and choose “No Color”.Click "Shading" and Choose a Color->Click "Text Highlight Color"->Choose "No Color"

Method 3: Convert Texts from Highlighted to Shaded via VBA

In addition, you can use a macro way to get you there.

  1. First of all, install and run macro following steps in method 1.
  2. Only this time, replace macro with this one:
Sub ConvertTextsFromHighlightedToShaded()
  Dim objCharacterRange As Range
 
  For Each objCharacterRange In ActiveDocument.Characters
    If objCharacterRange.HighlightColorIndex <> wdNoHighlight Then
      objCharacterRange.HighlightColorIndex = wdNoHighlight
      objCharacterRange.Shading.BackgroundPatternColor = wdColorDarkBlue
    End If
  Next objCharacterRange
End Sub

Things to Do When Word Collapses

Once Word corrupts, more often than not, your documents will get compromised. In such scenarios, hard it might be, you must stay calm. Here are your actions: go to check the latest backup and see if you can use it instead. If not, then it’s time to get hold of a doc repair tool.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair Excel and pdf repair software products. For more information visit www.datanumen.com

Comments are closed.