Page Property

See Also7OS48X2                 Example1X08V3P>Low

Applies To

Printer objectCBQUDQ.


Specifies the current page number.  Not available at design time and read-only at run time.




Visual Basic keeps a count of pages that have been printed since your application started or since the last Printer.EndDoc statement was executed.  This count starts at one and increases by one if:

         You use the NewPage1UOETVR method.

         You use the Print9V51E5 method and the text you wish to print does not fit on the current page.



Note   Graphics methodsAY3LGR output that does not fit on the page does not generate a new page.  The output is clipped to fit the page's printable area.


Data Type


See Also


EndDoc MethodRFC0FY

NewPage Method1UOETVR

Print Method9V51E5


Programmer's Guide:

Chapter 16, "Displaying and Printing Information"

Page Property Example

The example prints three pages of text with the current page number at the top.  To try this example, paste the code into the Declarations section of a form.  Then press F5 and click the form.

Sub Form_Click ()
  Dim Header, I, Y                             ' Declare variables.
  Print "Now printing..."                      ' Put notice on form.
  Header = "Printing Demo - Page "             ' Set header string.
  For I = 1 To 3
    Printer.Print Header;                      ' Print header.
    Printer.Print Printer.Page                 ' Print page number.
    Y = Printer.CurrentY + 10                  ' Set position for line.
    ' Draw a line across page.
    Printer.Line (0, Y) - (Printer.ScaleWidth, Y)    ' Draw line.
    For K = 1 To 50
      Printer.Print String(K, " ");            ' Print string of spaces.
      Printer.Print "Visual Basic ";           ' Print text.
      Printer.Print Printer.Page               ' Print page number.
  Next I
End Sub