NUMPAGES()

Returns the number of pages in the current document. This is taken directly from the Statistics page under the File/Properties menu.

See also:

Other document function