title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Pages.Count property (Publisher) |
vbapb10.chm458755 |
|
|
6cc42bb4-4862-6a59-168b-6a97a7e114c8 |
06/12/2019 |
medium |
Returns a Long that represents the number of items in the specified collection.
expression.Count
expression A variable that represents a Pages object.
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
[!includeSupport and feedback]