Generate Styles list with Definitions for a Template

C

chris24scanlon

Hi there. I cannot seem to find an option in MS Word (or a macro) that will
generate a list of the styles in a template along the style definition. Is it
possible to generate a list like this?
 
S

StevenM

To: Chris,

Do you want a list of all styles used in your document, or a list of all
styles available?
Each task has its own set of complication, but they are different.

Steven Craig Miller
 
C

chris24scanlon

Steven - Ideally all available styles. But if its easier to generate the list
of all styles used in a document, that will work too (it would be a
relatively simple task to create a document based on the all the styles).

Thanks! -chris
 
S

StevenM

To: Chris,

'
' ListAllStyles
'
Sub ListAllStyles()
Dim oStyle As Style
Dim sStyle As String
Dim actDoc As Document
Dim newDoc As Document

Set actDoc = ActiveDocument
Set newDoc = Documents.Add

For Each oStyle In actDoc.Styles
With oStyle
sStyle = "Style: " & .NameLocal & vbCr _
& "Font: " & .Font.Name & vbCr _
& "Size: " & .Font.Size & vbCr _
& .Description & vbCr _
& vbCr
End With
With newDoc.Range
.InsertAfter sStyle
.Collapse wdCollapseEnd
.MoveEnd wdCharacter, 1
End With
Next oStyle
End Sub

Steven Craig Miller
 

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