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 / November 2006

Tip: Looking for answers? Try searching our database.

Style in use

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
edo - 17 Nov 2006 21:23 GMT
Hi all,

is there a way with VBA to get a list of the "Styles in use" for the
current document?
Shauna Kelly - 17 Nov 2006 22:24 GMT
Hi Edo

The following will tell you whether the Body Text style has ever been used
in the document:

   ActiveDocument.Styles(wdStyleBodyText).InUse

but there's no guarantee that the style is currently in use.

The only way to see what styles are in current use is to cycle through the
text and look to see what styles are being used, or to use .Find to search
for a particular style. In either case, you'll need to determine whether you
want just the styles in use in the body of the document or also in other
StoryRanges such as footnotes, endnotes, headers, footers etc.

Let us know if you need more info.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> Hi all,
>
> is there a way with VBA to get a list of the "Styles in use" for the
> current document?
Greg Maxey - 17 Nov 2006 22:33 GMT
See my Style Report Add-In:

http://gregmaxey.mvps.org/Style_Report.htm
> Hi all,
>
> is there a way with VBA to get a list of the "Styles in use" for the
> current document?
 
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.