Getting a list of all styles

J

Joanne

Does anyone know if there's a way to list all of the
styles in a template(s) and save them to a file? Thanks
for your help.
 
C

Charles Maxson

This code will right the styles from active document into a text file
(located in the current directory)


Sub ListStyles()
Dim sty As Style

Open ActiveDocument.Name & "_Styles.txt" For Output Shared As #1

For Each sty In ActiveDocument.Styles
Print #1, sty.NameLocal
Next

Close

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