writing to a document the style properties

R

Rumcajz

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?
 
J

Jezebel

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.
 

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