numPages

Get the number of pages.
[read-only property] numPages([out, retval] int *numPages)
This property contains the number of pages in the currently open PDF file.

Internally, pages are numbered 1 to N, where N is the value in the numPages property, even if this doesn't match up with the document page numbering. For example, if a document has pages i-vii and 1-100, the PDF file will contain pages 1-107.

VB6:
n = pdf.numPages