Syntax
ToolsWordCount [.CountFootnotes = number] [, .Pages = text] [, .Words = text] [, .Characters = text] [, .Paragraphs = text] [, .Lines = text]
Remarks
Counts the number of pages, words, characters, paragraphs, and lines in the active document. The .CountFootnotes argument is the only one that can be set; the remaining arguments are read-only and can be used with a dialog record to return information about the active document. For more information, see the example for this entry. For information about dialog records, see Chapter 4, "Advanced WordBasic," in Part 1, "Learning WordBasic."
Argument | Explanation | |
.CountFootnotes | If 1, text in footnotes and endnotes is included in the count. | |
.Pages | The number of pages in the document. | |
.Words | The number of words in the document. | |
.Characters | The number of characters in the document. | |
.Paragraphs | The number of paragraphs in the document. |
Example
This example counts the number of pages, words, characters, paragraphs, and lines in the active document — including text in footnotes and endnotes — and then displays the word count in a message box:
ToolsWordCount .CountFootnotes = 1 Dim dlg As ToolsWordCount GetCurValues dlg MsgBox "Current word count: " + dlg.Words
See Also
DocumentStatistics, FileSummaryInfo