Document.ComputeStatistics Method

Word Developer Reference

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

Name Required/Optional Data Type Description
Statistic Required WdStatistic The statistic to compute.
IncludeFootnotesAndEndnotes Optional Variant True 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"

See Also