Returns the total number of pages in the document in a RichTextEdit control.
RichTextEdit controls
rtename.PageCount ( )
Argument |
Description |
---|---|
rtename |
The name of the RichTextEdit control in which you want the page count |
Integer. Returns the number of pages in the RichTextEdit control. Returns 1 if the control contains no text and -1 if an error occurs.
The number of pages in the document is determined by the amount of text and the layout specifications, such as page size, margins, font size, and so on.
When the RichTextEdit control shares data with a DataWindow, there is an instance of the document for each row of the DataWindow. PageCount reports the page count of a single instance. Multiply the value of the DataWindow’s RowCount function by the page count to get the total number of pages.
This example displays the number of pages in the document in the RichTextEdit rte_1 as the text of the StaticText st_status:
st_status.Text = String(rte_1.PageCount())
RowCount method for DataWindows in the DataWindow Reference or the online Help