Results 1 to 3 of 3

Thread: Activating the printer.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2003
    Location
    Georgetown, Texas
    Posts
    114

    Activating the printer.

    Hello, all.

    I have this code, in VB:
    Code:
    Sub Private Sub Form_Load()
    		
       Printer.Print, "This is line 1"		
       Printer.Print, "And, this is line 2"		
    
    End Sub
    When I run it, it sends the two lines to the printer, but, it only prints if:
    1. I press the printer's manual PRINT key.
    2. Or, if I end the sub by clicking the black square in VB's Menu bar
    3. Or, if I end the sub by adding End before the End Sub

    Adding the following line, just before the End sub, did NOT fix the problem:
    Printer.Print , Chr(12) ' Form feed

    How would I fix this so that I can tell the printer to print those two lines, other than by the above three methods?

    Thanks for any help

    Ralph

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    printer.newpage - skips to a new page

    and

    printer.enddoc - closes the document and starting printing

    formfeeds - chr(12) - are not what windows print drivers want for page ejecting...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2003
    Location
    Georgetown, Texas
    Posts
    114
    Thank you so much, Szlamany, for your quick and complete answer! That did it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width