Loading
Word.Tips.Net WordTips (Menu Interface)

Running Word Counts

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.

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.

Related Tips:

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

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

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.