Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Word macro to remove all content thats in red color.

Hi All,

Word macro to remove all content thats in red color.
Can anyone help.
All content in red color to be removed

thanks
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

If you are just talking about text with a specific red colour, you can do a Find and Replace operation.

Do Crtl+H to open the dialogue. click on the More button, choose Format, then Font. Select the colour in the' Font color:' box. Then Click OK and Replace All
Avatar of bsharath

ASKER

I want to remove the red words.
Delete them
Oops. I missed the fact that you want to know how to do it with a macro.
Sub DelRedWords()
    With ActiveDocument.Range.Find
        .Text = "<*>"
        .Font.Color = wdColorRed
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub

Open in new window

Thanks
Perfect but special characters are not deleted
What sort of special characters ?
<> -    () :     .      .
"   "      =   ("").        .

:
= = = =
= = = =
= = = =
= = = =
  ::


some are above
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial