mkofler
09-24-2013, 07:34 PM
Hi
I want to loop thru all the styles in a document and print out their properties. As there are a large amount of properties, I store the names of the properties in an array. I want to loop thru the array to the get names of the property I want to display.
How do I use the strings in the array as the property names in the following code?
Dim arrStyleProps a string
Dim style as Style
arrStyleProps = Array("Application", "Automatically Update", "BaseStyle", _
"Borders", "BuiltIn ", "Creator", "Description", "Font", _
"Frame", "In Use", "Language ID", "Language ID Far East", "Linked", _
"Link Style", "List Level Number", "ListTemplate", "Locked ", _
"NameLocal", "NextParagraphStyle", "NoProofing", "No Space Between Paragraphs Of Same Style", _
"Paragraph Format", "Parent", "Priority", "QuickStyle", "Shading", _
"Table", "Type", "Unhide When Used", "Visibility")
For Counter = 0 To UBound(arrStyleProps)
For Each style In ActiveDocument.Styles
debug.print style.arrStyleProps(counter)
next style
next counter
I want to loop thru all the styles in a document and print out their properties. As there are a large amount of properties, I store the names of the properties in an array. I want to loop thru the array to the get names of the property I want to display.
How do I use the strings in the array as the property names in the following code?
Dim arrStyleProps a string
Dim style as Style
arrStyleProps = Array("Application", "Automatically Update", "BaseStyle", _
"Borders", "BuiltIn ", "Creator", "Description", "Font", _
"Frame", "In Use", "Language ID", "Language ID Far East", "Linked", _
"Link Style", "List Level Number", "ListTemplate", "Locked ", _
"NameLocal", "NextParagraphStyle", "NoProofing", "No Space Between Paragraphs Of Same Style", _
"Paragraph Format", "Parent", "Priority", "QuickStyle", "Shading", _
"Table", "Type", "Unhide When Used", "Visibility")
For Counter = 0 To UBound(arrStyleProps)
For Each style In ActiveDocument.Styles
debug.print style.arrStyleProps(counter)
next style
next counter