I want to loop through the styles in a document and write to that document
the attributes of each style. I want the output to be a list, but I don't
want a fixed format for the list. For example I don't want to have a list
item of bold, italics or space before if they aren't properties of the style.
I can use ActiveDocument.Styles(index).Description to give me the details I
want, but the format is like this:
Font: (Default) Times New Roman, 11 pt, Do not check spelling or grammar,
English (U.K.), Indent: Left: 1 cm, Left, Line spacing: single, Space
Before: 2 pt, After: 6 pt, Widow/Orphan control
I then have to sort the code and put it into a list format. With a mixture
of commas and colons to use as delimiters for the sorting this could be
messy.
Does anyone have a better way of getting the information other than using
ActiveDocument.Styles(index).Description or some hints on the sorting?
Jezebel - 05 Aug 2005 09:53 GMT
The least-effort method is to go to File > Print and select Styles from the
'Print what' list. If you want to edit the list, print to Acrobat if you
have it, or install a generic text printer on port FILE:. The list you get
shows only the interesting features of each style (as you descibe). It does
show every style; but that maybe doesn't matter: or if it does, delete them
manually. Still much quicker than mucking around writing code.
>I want to loop through the styles in a document and write to that document
> the attributes of each style. I want the output to be a list, but I don't
[quoted text clipped - 16 lines]
> Does anyone have a better way of getting the information other than using
> ActiveDocument.Styles(index).Description or some hints on the sorting?