Style in use

E

edo

Hi all,

is there a way with VBA to get a list of the "Styles in use" for the
current document?
 
S

Shauna Kelly

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
 
Top