Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
Returns a Long that represents the number of items in the specified collection.
Syntax
expression.Count
expression A variable that represents a Fields object.
Example
This example displays the number of pages in the active document.
Sub CountNumberOfPages()
MsgBox "Your publication contains " & _
ActiveDocument.Pages.Count & " page(s)."
End Sub
This example displays the number of shapes in the active document.
Sub CountNumberOfShapes()
Dim intShapes As Integer
Dim pg As Page
For Each pg In ActiveDocument.Pages
intShapes = intShapes + pg.Shapes.Count
Next
MsgBox "Your publication contains " & intShapes & " shape(s)."
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.