Forum Discussion
JennyT2070
Aug 12, 2025Copper Contributor
How to download all the styles details easily
Is there a way to download all the details of all the styles in a document? For now, I am clicking "modify" manually in each style and write down all the details. This is too manual. Is there a w...
Kidd_Ip
Aug 13, 2025MVP
How about VBA:
Sub ExportStyleDetails()
Dim s As Style
Dim docNew As Document
Set docNew = Documents.Add
For Each s In ActiveDocument.Styles
If s.Type = wdStyleTypeParagraph Or s.Type = wdStyleTypeCharacter Then
With docNew.Content
.InsertAfter "Style Name: " & s.NameLocal & vbCrLf
.InsertAfter "Font: " & s.Font.Name & ", Size: " & s.Font.Size & vbCrLf
.InsertAfter "Bold: " & s.Font.Bold & ", Italic: " & s.Font.Italic & vbCrLf
.InsertAfter "Paragraph Alignment: " & s.ParagraphFormat.Alignment & vbCrLf
.InsertAfter "Space Before: " & s.ParagraphFormat.SpaceBefore & ", After: " & s.ParagraphFormat.SpaceAfter & vbCrLf
.InsertAfter "Line Spacing: " & s.ParagraphFormat.LineSpacing & vbCrLf
.InsertAfter String(40, "-") & vbCrLf
End With
End If
Next s
End Sub
- JennyT2070Aug 13, 2025Copper Contributor
I tried to copy and paste your VBA and run it. It prompt a bug:
.InsertAfter "Paragraph Alignment: " & s.ParagraphFormat.Alignment & vbCrLf
In addition, I have the document opened and run the macro. the output is not correct...it is not showing the styles saved in the document. There are unique names for the styles in this document which is how I can tell the output of the VBS is not showing correct.