Deleting text formatted with a certain paragraph style including the paragraph mark

A

andreas

I would like to delete all text occurrences formatted with a specific
custom paragraph style including the paragraph mark. I am not sure how
to achieve this. Help is appreciated. Thank you very much in advance.

Regards,


Andreas
 
G

Greg Maxey

You don't need VBA to do this. Just use Edit>Replace. Find the style and
replace with nothing.
 
A

andreas

You don't need VBA to do this. Just use Edit>Replace. Find the style and
replace with nothing.

--
Greg Maxey/Word MVP
See:http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.




- Zitierten Text anzeigen -


Greg,

thank you for your information. With your help I wrote the following
macro (deleting this style will be a repetitive task).

Sub DelSubTOCStyle()

With ActiveDocument.Content.Find
.ClearFormatting
.Replacement.ClearFormatting
.Style = ActiveDocument.Styles("Dipl_SubTOC")
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top