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
LVL 11
bsharathAsked:
Who is Participating?
 
GrahamSkanRetiredCommented:
Sorry. It was only looking for words as requested. Here is how to delete all red text.


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

0
 
GrahamSkanRetiredCommented:
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
0
 
bsharathAuthor Commented:
I want to remove the red words.
Delete them
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
GrahamSkanRetiredCommented:
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

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

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


some are above
0
 
bsharathAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.