View Single Post
 
Old 10-23-2014, 10:27 AM
ljd108 ljd108 is offline Windows Vista Office 2010 32bit
Novice
 
Join Date: Oct 2014
Posts: 24
ljd108 is on a distinguished road
Default Macro to delete text in specific styles

Hi,

I have found the following macro that deletes text in a particular style. I need to remove text that are made up of multiple styles in a document (about 15 of them) please could someone let me know if there is a quick way of adapting this macro to make it delete multiple styles rather than just "Heading 3"?

Thanks

Sub DeleteStyledText()
With ActiveDocument.Content.Find
.ClearFormatting
.Style = ActiveDocument.Styles("Heading 3")
Do While .Execute(FindText:="", Forward:=True, Format:=True) = True
.Parent.Delete
Loop

End With
End Sub
Reply With Quote