Count Property Example

This example uses the Count property to display the number of command bars in the CommandBars collection.

MsgBox "There are " & CommandBars.Count & _
    " bars in the CommandBars collection."

This example uses the Count property to display the number of check boxes in the Office Assistant balloon.

With Assistant.NewBalloon
    .CheckBoxes(1).Text = "First Choice"
    .CheckBoxes(2).Text = "Second Choice"
    .Text = "You have the following " _
    & .CheckBoxes.Count & " choices."
    .Show
End With

This example displays the number of custom document properties in the active document.

MsgBox ("There are " & _
    ActiveDocument.CustomDocumentProperties.Count & _
    " custom document properties in the " & _
    "active document.")