1

I would like to print directly to an attached label printer without showing the print dialog.

I have searched to see if such a thing is possible but it seems it is not. So, I thought I would ask here in case someone knows a way to do it.

Floyd Resler
  • 1,786
  • 3
  • 22
  • 41

1 Answers1

1

You have to save the Printer SetupString. Then the next time you go to print use that SetupString to initialize the PrinterSetup object. See actual code copied from working project below:

 'Now print the mail barcode
  dim ps as PrinterSetup
  dim page as Graphics
  ps = LabelPrinter  //See below 
  if ps<>nil then
    page = OpenPrinter(ps)
    if page<>nil then
      //send stuff to the printer here



Public Function LabelPrinter() as PrinterSetup
  if gLabelSetup<>"" then  //gLabelSetup is saved in preferences
    dim ps as new PrinterSetup
    ps.SetupString = gLabelSetup
    return ps
  else
    return nil
  end if
End Function
BKeeney Software
  • 1,299
  • 6
  • 8
  • Oh, yeah. I actually had done this many years ago and completely forgot how. Thanks for the code and the refresher! – Floyd Resler Oct 25 '16 at 16:38