ComputeStatistics Method [Word 2007 Developer Reference]

Switch View :
ScriptFree
Document.ComputeStatistics Method
Returns a statistic based on the contents of the specified document. Long.

Syntax

expression.ComputeStatistics(Statistic, IncludeFootnotesAndEndnotes)

expression   Required. A variable that represents a Document object.

Parameters

NameRequired/OptionalData TypeDescription
StatisticRequiredWdStatisticThe statistic to compute.
IncludeFootnotesAndEndnotesOptionalVariantTrue to include footnotes and endnotes when computing statistics. If this argument is omitted, the default value is False.

Remarks

Some of the constants listed above may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.

Example

This example displays the number of words in the active document, including footnotes.

Visual Basic for Applications
MsgBox ActiveDocument.ComputeStatistics(Statistic:=wdStatisticWords, _
    IncludeFootnotesAndEndnotes:=True) & " words"