I have this macro that displays the style name for all
paragraphs in a document. I use this to easily check to
make sure certain styles are used. Is there a way to
reverse this and have the style name removed?
Thanks
Sub TagParas()
Dim p As Paragraph
Dim sText As String
Dim sStyle As String
For Each p In ActiveDocument.Paragraphs
sStyle = p.Style
p.Range.InsertBefore "@" + sStyle + " = "
Next p
End Sub
Jean-Guy Marcil - 17 Feb 2005 20:43 GMT
Jerry was telling us:
Jerry nous racontait que :
> I have this macro that displays the style name for all
> paragraphs in a document. I use this to easily check to
[quoted text clipped - 15 lines]
>
> End Sub
Instead of doing this, why don't you display the document in Normal view,
and in the Tools menu > Options > Set the "Style area width" to 1 inch or
so?
Then when you want to scan for styles, just switch to normal view.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Helmut Weber - 18 Feb 2005 08:39 GMT
Hi Jerry,
just for fun.
If it has to be:
Sub Test764()
Dim p As Paragraph
Dim r As Range
For Each p In ActiveDocument.Paragraphs
Set r = p.Range
r.End = r.start + Len(p.Style) + 4
r.Delete
Next p
End Sub
But I'd rather use Jean-Guy's method.
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000