Word.Tips.Net Welcome toWord.Tips.Net

Helpful Links

Tips.Net Home
WordTips Home

Ask a Word Question
Make a Comment

Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

Newest Tips

Arranging Document Windows

Specifying a Backup Location

Controlling Chart Gridlines

Merging Table Cells

Collapsing and Expanding Subdocuments

Zooming With the Keyboard

Initiating a New Search

 

Determining How Many Styles are Available in WordBasic

Summary: Quickly figure out how many styles are in your document by using this WordBasic code. (This tip works with Microsoft Word 6, and Word 95.)

You can determine the number of styles available in a document (when creating a WordBasic macro) by using the CountStyles() function. This is done using the following syntax:

x = CountStyles()

where x is the variable you can then use in other macro lines. Note that this function indicates how many have been defined, not how many of those are actually in use. This means that built-in styles are also counted.

Tip #802 applies to Microsoft Word versions: 6 | 95

More Power! For some people, the prospect of creating Word macros can be scary. WordTips: The Macros can help you conquer your fears and you'll discover you're much more confident and productive as you make Word do exactly what you want. This is an invaluable source for learning macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of WordTips. Learn at your own pace, exactly the way you want.
 
Check out WordTips: The Macros today!