I am trying to create a macro that will delete text that is formatted with a certain Word Style. I created the following macro, which is supposed to replace text with the format style "RedText" with the format style "Normal". The actions work when I am recording the macro, but nothing happens when I run the macro.
Sub RedText()
'
' RedText Macro
' Macro recorded 7/26/2005 by
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Redtext")
Selection.Find.ParagraphFormat.Borders.Shadow = False
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Normal")
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Any help of this would greatly be appreciated...!
Sub RedText()
'
' RedText Macro
' Macro recorded 7/26/2005 by
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Redtext")
Selection.Find.ParagraphFormat.Borders.Shadow = False
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = ActiveDocument.Styles("Normal")
Selection.Find.Replacement.ParagraphFormat.Borders.Shadow = False
With Selection.Find
.Text = ""
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Any help of this would greatly be appreciated...!