![]() |
|
#2
|
||||
|
||||
|
Does this work for you?
Code:
Sub HighlightTagger()
Dim aRng As Range
Set aRng = ActiveDocument.Range
With aRng.Find
.Text = ""
.ClearFormatting
.Replacement.ClearFormatting
.MatchWildcards = False
.Forward = True
.Wrap = wdFindStop
.Highlight = True
Do While .Execute
Select Case aRng.HighlightColorIndex
Case wdYellow
aRng.InsertBefore "[Color: Yellow]"
Case wdBlue
aRng.InsertBefore "[Color: Blue]"
Case Else
aRng.InsertBefore "[Color: Other]"
End Select
If aRng.Characters.Last = vbCr Then
aRng.Characters.Last.InsertBefore "[/Color]"
Else
aRng.InsertAfter "[/Color]"
End If
aRng.Collapse Direction:=wdCollapseEnd
Loop
End With
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
| Tags |
| highlight, highlight color |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Text Field [content control] - Default text color vs Filled Text color
|
jackcoletti | Word | 3 | 02-01-2017 08:10 AM |
Cannot see highlighted text for moving text in a do ument
|
Jonfrank1@me.com | Project | 1 | 01-09-2017 06:04 PM |
I need to convert shaded text into highlighted text on about 80 different long documents. VBA macro?
|
AustinBrister | Word VBA | 8 | 05-28-2015 02:42 PM |
Formatting- Apply changes to highlighted text results in same change to other text
|
sential | Word | 6 | 01-10-2014 03:22 PM |
| Macro for tagging and rearranging selected text for revision | caotico | Word VBA | 0 | 03-28-2012 06:35 PM |