Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

writing to a document the style properties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rumcajz - 04 Aug 2005 18:04 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.