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.
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.
- First and foremost, invoke VBA editor by pressing “Alt+ F11”.
- Next click “Normal” project on the left column.
- Then click “Insert” tab on the menu bar.
- Choose “Module” there.
- 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
- Last but not the least, click “Run” to get the codes executed.
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.
- To start off, click “Home” tab and then the drop-down button on “Find” command.
- Next select “Advanced Find” on that menu.
- Then in “Find and Replace” box, put insertion pointer inside “Find what” box.
- Click “More” to bring out more options.
- Next click “Format” and select “Highlight”.
- And click “Find In” tab.
- Choose “Main Document”. You shall see all highlighted texts in current document are in selection now.
- Next click on the drop-down button on “Shading” command under “Home” tab.
- Choose a desired color for text background.
- Then click on drop-down button on “Text Highlight Color” command and 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.
- First of all, install and run macro following steps in method 1.
- 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.
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