Home > BSPrinter documentation > Reference

GetDocLastPageIndex Method

Applies to: PrintPreview, IPrinterEx object

  Return Type:     Long  
   In     Optional     ReferencePageIndex     As     Variant  


Returns the page index where a document ends.


A report can have more than one document.
If in the middle of the Printing routine there is an EndDoc statement, the Print Preview dialog box will show more than one document. Each document will have its page numbers, and by calling this method it is possible to get the page index of the last page of a particular document.
If the ReferencePageIndex parameter is supplied, it will return the index of the last page of the document that the page referenced by ReferencePageIndex belongs. If this parameter is omitted, the current page will be used as the reference.

See Also:

GetDocFirstPageIndex method
GetDocPageCount method
GetPageNumber method
StartDoc event