Words.Count Property

Word Developer Reference

Returns a Long that represents the number of words in the collection. Read-only.

Syntax

expression.Count

expression   Required. A variable that represents a Words collection.

Example

This example displays the number of words in the selection.

Visual Basic for Applications
  If Selection.Words.Count >= 1 And _
        Selection.Type <> wdSelectionIP Then
    MsgBox "The selection contains " & Selection.Words.Count _
        & " words."
End If

See Also