Welcome toWord.Tips.Net
Ask a Word Question
Make a Comment
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
Printing On Both Sides of the Paper
Turning Off AutoComplete for Dates
Understanding Auto Line Spacing
Adding Comments to Your Document
Conditional Calculations in Word
Word has this nifty tool that counts the number of words in your document for you. The only problem is, it doesn't count all words. For instance, if your document contains text boxes, the word count tool won't include any text in the word boxes in the overall word count for the document. This can be a real problem, particularly if you are using text boxes to implement a special document element, such as sidebars.
There is a way around the problem, however. You can count all the words in the main portion of your document as you normally would, and then write down that number. Then move the insertion point into a text box. If you run the word count tool, Word returns the number of words in that text box. If you select multiple text boxes before running the word count tool, then Word returns the count of all words in all the text boxes you selected. If you are using linked text boxes, then you don't have to select them all, but you do need to move the insertion point into the last text box in the series. When you add together the word count in the main document, plus the word count for any text boxes, you will have the word count for the entire document.
If you use text boxes a lot, the above process can get rather bothersome. If you prefer, you can create a macro that will automate the process for you. The following macro determines the word count in the main document, and adds to it the word count for each text box in the document. The result is a total word count, as described above.
Sub TxtBxCount()
Dim i As Integer
Dim TxtWrds As Range
Dim TxtWrdsStats As Long
Dim ToTxtWrds As Long
Dim Lngwords As Long
Dim ToWords As Long
Lngwords = ActiveDocument.BuiltInDocumentProperties(wdPropertyWords)
For s = 1 To ActiveDocument.Shapes.Count
Set TxtWrds = ActiveDocument.Shapes(s).TextFrame.TextRange
TxtWrdsStats = TxtWrds.ComputeStatistics(Statistic:=wdStatisticWords)
ToTxtWrds = ToTxtWrds + TxtWrdsStats
Next
ToWords = Lngwords + ToTxtWrds
MsgBox ("The document has " & Format(ToWords, "##,##0") & " words.")
End Sub
Tip #1658 applies to Microsoft Word versions: 97 2000 2002 2003
Create and Merge! Using Word's mail merge tool you can quickly and easily combine data from a variety of data sources to create great individualized documents that incorporate your data in ways that you control. WordTips: Mail Merge Magic is an invaluable source for learning how to harness the full power of Word's mail merging capabilities.