USB port printer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Azizul Haq
    New Member
    • Jul 2007
    • 3

    USB port printer

    How can I use deirectly a printer attached to a USB port through VB6 coding?d
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by Azizul Haq
    How can I use deirectly a printer attached to a USB port through VB6 coding?
    Don't. Use the Printer object. It's much safer.

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by Killer42
      Don't. Use the Printer object. It's much safer.
      Azizul Haq, you appear to have used the "Report" button instead of the "Reply" button. Please try again.

      Comment

      • Azizul Haq
        New Member
        • Jul 2007
        • 3

        #4
        Many of my clients want to use the printer to print discrete page and want the printer to stop where the bill finishes. I use: Open "Lpt1" for output as #1
        which works better in win98 and XP but it fails for USB printer and network printer.
        The printer object gives full page in XP because Printer.Height property does not work in XP. Please Help for USB port and network printer.

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Originally posted by Azizul Haq
          many of my clients want to use the printer to print descrete page and want the printer to stop where the bill finishes. I use: Open "Lpt1" for output as #1
          which works better in wn98 and xp but it fails for usb printer and network printer.
          The printer object gives full page in xp because printer.height property does not work in xp. Plese Help for USB port and network printer.
          I don't know anything about using USB or network printers, perhaps someone else here does? Perhaps it's just a matter of finding the correct port name to open.

          However, I would like to ask - have you tried adjusting the Printer.PaperSi ze property?

          Comment

          • Azizul Haq
            New Member
            • Jul 2007
            • 3

            #6
            Printer.PageSiz e picks the pre-adjusted paper size but does not work as I want. My dynamic paper size starts from 7 lines and maximum paper size is up to 500 lines on continuous paper. It should stop anywhere when the lines finish.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Well, I'm fresh out of ideas so I'll throw in a bunch of links to possibly relevant sites I just found in Google...




              http://www.thescripts.com/forum/thread677530.html



              If these don't help, I recommend further searching, through Google or perhaps on the MSDN website.

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Just a thought. If you run this...[CODE=vb]Dim p As Printer
                For Each p In Printers
                Debug.Print p.Port, p.DeviceName
                Next[/CODE]...then try using the port name reported, instead of LPT1, what happens?

                Comment

                • Killer42
                  Recognized Expert Expert
                  • Oct 2006
                  • 8429

                  #9
                  Originally posted by Ali Rizwan
                  ... I want to take a print of a msflexgrid in vb6 ...
                  Since this is a new question, please start a new discussion thread for it. Don't tack it onto the end of this one.

                  Comment

                  Working...