Private Sub Command1_Click()
Printer.ColorMode = 2
Printer.Print " "; ' force a call to StartPage
' Printer.CurrentX = 0 ' restore the position
Printer.ForeColor = vbRed
Printer.Print "page 1nyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
' Printer.NewPage
' Printer.Print "Page 2"
Printer.EndDoc
End Sub
Private Sub Command2_Click()
Printer.ColorMode = 2
Printer.Print " "; ' force a call to StartPage
Printer.CurrentX = 0 ' restore the position
Printer.ForeColor = vbRed
Printer.Print "Page 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Printer.NewPage ' VB only calls EndPage here
' The following three lines are not necessary for NT/Windows 2000
' But you need them if you want to make the code work under Windows 9x or Windows Me
Printer.Print " "; ' force a call to StartPage
Printer.CurrentX = 0 ' restore the position
Printer.ForeColor = vbRed
Printer.Print "Page 2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Printer.EndDoc
End Sub