View Single Post
 
Old 01-22-2019, 05:46 AM
melp melp is offline Windows 10 Office 2010
Novice
 
Join Date: Jan 2019
Posts: 1
melp is on a distinguished road
Default

Hello I tried the below code but this is not working ie no text was deleted in my doc.
Could someone explain to me why?

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

Thanks in advance

Mel
Reply With Quote