Forum Discussion
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 way to see all of them so that I can copy easily the details in a notepad etc.
I do not mean copying styles to another document. I meant copying the settings/details of all the styles so that I can put them into some kind of manual document for others to refer to.
2 Replies
- 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- JennyT2070Copper ContributorI 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.