bottom
Great WordTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > WordTips Home > Tools > Word Count > Counting Words the Old Fashioned Way with WordBasic

Counting Words the Old Fashioned Way with WordBasic

Summary: Using the old editorial method of figuring out the number of words in a document. (This tip works with Microsoft Word 6, and Word 95.)

You probably already knew that Word provides a way to determine the number of words in a selection or in your entire document. Word has its own internal algorithms to figure out the proper count. This is great, if you need to know actual word counts.

Before the days of actual word counts, however, typists figured out the number of average words in a document. This was done by figuring out the number of characters typed, and then dividing that figure by five. For some purposes you may still need to figure word counts using this old-fashioned approach. This can be done with a simple WordBasic macro, as follows:

Sub MAIN
    Title$ = "WordCount"
    On Error Goto HugeString
    InSelection = SelType()
    If InSelection = 2 Or InSelection = 6 Then
        WordCount = Int((Len(Selection$()) / 5) + 0.5)
        WordCount$ = Mid$(Str$(WordCount), 2) + " word"
        If WordCount > 1 Then WordCount$ = WordCount$ + "s"
        MsgBox WordCount$, Title$
    Else
        Beep
        MsgBox "No text selected", Title$, 16
    End If
    Goto Done

    HugeString:
        MsgBox "Selection too large", Title$, 48

    Done:
End Sub

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


Take Control! Master the real power behind Word! Successfully master the secrets of powerful formatting and create documents that stand out from the rest. Best of all, you can create documents that are easy to maintain and quick to change.
 
Check out Word 2007 Styles and Templates today!

Helpful Links

Ask a Word Question
Make a Comment

Tips.Net Home
Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

 

Great Info!

Get tips like this every week in WordTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)