Why my printer.print only work AFTER I close the form?

IgnatiusGo
08-21-2009, 07:39 AM
Sorry, I know this sound stupid, but I never use printer.print before. I tried a single form with a single command button. Then I add this code:

Private Sub Command1_Click()
Printer.Print
Printer.Print "Hello World"
End Sub

I thought it will print a blank line and then a line of "Hello World", then stop right there (which is what I want), however, it does not do much at all when I click the command button (I check the printer queue, it wrote "spooling" but no action on the printer, only when I close the form (which shut it down), the printer reacts. Why is that? Can I just set the printer to print the two line and just stop there?

Hugh Lerwill
08-21-2009, 11:06 AM
Private Sub Command1_Click()
Printer.Print
Printer.Print "Hello World"
Printer.EndDoc
End Sub

IgnatiusGo
08-21-2009, 09:12 PM
Thanks, that make the printer to work. However, it also eject the whole page. What I want is that it print the two lines and stop. The idea is to print other stuff more on the same page later. Help, please?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum