Microsoft Office Tutorials and References
In Depth Information
Removing All Highlighting
Removing All Highlighting
This procedure removes all highlighting in a document or part of a document.
Example file:
W004
Scenario: A technique used in working with Word
documents is highlighting to make something visible while
working in a document. This method is proposed in some of
the macros in this topic. At some point, you’ll want to remove
the highlighting that you applied.
Wrd
Tip: If you make a mistake and run the macro unintentionally, don't panic! Simply use
Edit/Undo and the highlighting will be restored.
View the Appendix to learn how to store this procedure
in a Standard module.
Option Explicit¶
' * * * * *¶
Sub RemoveHighlighting()¶
If Selection.Type = wdSelectionIP Then¶
ActiveDocument.Range.HighlightColorIndex _¶
= wdNoHighlight¶
ElseIf Selection.Type = wdSelectionNormal Then¶
Selection.Range.HighlightColorIndex _¶
= wdNoHighlight¶
Else¶
MsgBox "No text is selected."¶
End If¶
End Sub¶
 
Search JabSto ::




Custom Search