API Documentation > CorelDRAW > 2025-v26 > Pages > IVGPages
Pages.Count property
Gets the number of items in the collection of pages
Syntax:
Property Get Count() As Long
Remarks:
The Count property returns the number of pages in a document.
Examples:
The following VBA example returns a message if the document contains only one page.
Sub Test()
Dim ret As VbMsgBoxResult
If ActiveDocument.Pages.Count = 1 Then
  ret = MsgBox("Document contains only 1 page. Do you want to continue?", vbYesNo)
  If ret = vbNo Then Exit Sub
  End If

End Sub