In a document use the highlighter to highlight particular text or range to make good resemblance.
With the help of little code we can achieve this task. In given example we will be using “Selection” object, developer can change this object to anything which refers to a range like grab an object by Find and take the range and perform highlight operation;
The following is the document on which we will perform highlight operation:
Sub HighlightText() Dim rng As Range Set rng = Selection.Range rng.HighlightColorIndex = wdBlue End Sub
wdBlue is a constraint which can be replaced with desired color constraint provided by Micorosoft. Post execution of above code the result would look like as follow:
Next >> Word Story Ranges with code example