title: Printer.print object vb6
body: <p>I developed application which print receipts, used visualbasic powerpack libraries to print with vb6 printer class which is very handy for such task. BUT, i have anoying problem with printing dialog poping out while receipt is printing and pausing my application for time being showed.
  Here is code and picture</p>
  
  <pre><code>Private Sub SetPrinterName(ByVal PrinterName As String, ByVal AppPath As String)
      Dim prnPrinter As Printer
  
      For Each prnPrinter In Printers
          If prnPrinter.DeviceName = PrinterName Then
              p = prnPrinter
              Exit For
          End If
      Next
      p.DocumentName = "ERP System"
      Me.Path = AppPath
      p.PrintAction = Printing.PrintAction.PrintToPrinter
      p.CurrentX = 0
      p.CurrentY = 10
      p.Print("Receipt")
      p.EndDoc
  End Sub
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/rs8yj.jpg" alt="small dialog"></p>