Monday, February 27, 2023

Word Macro to Remove Highlight and Shading from Text

 Remove highlighting and shading (for instance, to remove highlighting from Finereader OCR):

Sub RemoveShadingandHighlights()
  Selection.Font.Shading.Texture = wdTextureNone
  Selection.Shading.BackgroundPatternColor = wdColorWhite
  Selection.Shading.ForegroundPatternColor = wdColorWhite
  Selection.Range.HighlightColorIndex = wdNoHighlight
End Sub

Remove highlighting:

Sub RemoveAllHighlights()
  Selection.Range.HighlightColorIndex = wdNoHighlight
End Sub
Remove shading: 
 Sub RemoveShading()
  Selection.Font.Shading.Texture = wdTextureNone
  Selection.Shading.BackgroundPatternColor = wdColorWhite
  Selection.Shading.ForegroundPatternColor = wdColorWhite
End Sub