PageCount Property

Microsoft Publisher Visual Basic

expression.PageCount

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

A reader spread can contain no more than two pages.

Example

The following example checks the reader spread of the third page in the active publication to see if it contains more than one page, then displays the total number of pages in the spread.

Sub NumberOfPagesInSpread()
    If ActiveDocument.Pages(3).ReaderSpread.PageCount > 1 Then
        MsgBox "The spread has two pages."
    Else
        MsgBox "The spread has only one page."
    End If
End Sub