PDA

View Full Version : Macro for Change text color and highlight



alrizwan
12-21-2010, 08:27 PM
Dear gmaxey!

you sent me this vba code thanks I want to chage text color from other different colors exept black color your code chages the color of all Documents at once
but I want to search other color one by one and change in black color
thanks.


Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Highlight = True
While .Execute
oRng.HighlightColorIndex = wdYellow
Wend
End With
Set oRng = ActiveDocument.Range
oRng.Font.Color = wdColorBlack
End Sub

Simon Lloyd
12-22-2010, 01:03 AM
Alrizwan, please PM me here to confirm that you will abide by our rules, after this confirmation i will unlock your post, if you do not contact me you wil incurr a ban.