Running Word Counts

Written by Allen Wyatt (last updated December 8, 2018)
This tip applies to Word 97, 2000, 2002, and 2003


Word provides a built-in tool that allows you to get a count of the number of words in your document. However, some people prefer to have a constantly updated count of words in their document. In that way, they can keep an eye on the word counter and stop writing when they have reached the desired number of words in their document.

Unfortunately, Word does not provide a built-in running word count that you can turn on or off. You can, however, create a macro that will provide the necessary information for you. The following nifty macro will display a constantly updating word count at the end of the formatting toolbar:

Sub WordCounter()
    Set myBar = CommandBars("Formatting")
    Set myControls = myBar.Controls
    NumButtons = myControls.Count

    ButtonLoc = 0
    For J = 1 To NumButtons
        If myControls(J).Type = msoControlButton Then
            ButtonName$ = myControls(J).OnAction
            If ButtonName$ = "WordCounter" Then ButtonLoc = J
        End If
    Next J

    If ButtonLoc = 0 Then
        ButtonLoc = NumButtons + 1
        Set newControl = myControls.Add(Type:=msoControlButton)
        newControl.OnAction = "WordCounter"
        newControl.Style = msoButtonCaption
    End If

    Set myRange = ActiveDocument.Content
    WdCount = myRange.ReadabilityStatistics(1).Value
    With myControls(ButtonLoc)
        .Caption = WdCount
    End With

    Application.OnTime When:=Now + TimeSerial(0, 0, 5), _
      Name:="WordCounter"
End Sub

Note that this macro adds the word count at the end of the formatting toolbar when it first runs. The toolbar button stays there from then on. If you later modify your toolbar so the button is not at the end of the toolbar, the macro will find it and act accordingly.

When you first start Word (after having run this macro), you will need to click on the toolbar button to start the macro. Of course, you can create a separate AutoStart macro that would run WordCounter when you first begin Word.

One thing to note about the macro is that it reruns every five seconds. If this is too often, you can change the value (5) in the TimeSerial function near the end of the macro. Depending on the speed of your system, you may note a slight disturbing screen flicker every time the macro runs, but you will definitely have an updated word count. If you instead want the word count only when you click on the button on the toolbar, simply remove the Application.OnTime line near the end of the macro.

If you want to remove the macro so it does not run any more, you should follow these three simple steps:

  1. Exit Word.
  2. Restart Word. The macro is now not running.
  3. Edit your formatting toolbar to remove the WordCounter button.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1745) applies to Microsoft Word 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Determining Differences Between Dates

Do you need to do some simple math using dates in a your macro? One of the easy functions you can use is the DateDiff ...

Discover More

Reloading Building Blocks

Building Blocks can be a powerful tool for document creation in Word. Saving your Building Blocks and reloading them into ...

Discover More

Printing More than One Copy

Need to print more than a single copy of a worksheet? You can do it easily by using the printing controls provided by Excel.

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (menu)

Word Count for a Section

Dynamic word counts for your entire document are easy to get when you use using fields. There is no built-in method to ...

Discover More

Counting Words the Old Fashioned Way

One way to specify word count is to count characters and divide by five. If you still need this old-fashioned way of ...

Discover More

Word Count in Multiple Selections

Getting a word count for an entire document is easy. What you may not know is that some versions of Word can also provide ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.