-
Hello gurus!
I was wondering is it possible to choose the used printer directly by code without any dialog boxes etc? If it is, could someone give a little code how... :)
Also, is there any way to select an orientation of the printer via code? Also, I'd like to know how to modify the scaling... I have tried Printer.Orientation and Printer.Zoom -methods but they didn't work.
.................................
Ville Mattila
Ikaalinen, Finland
[email protected]
-
Check out the Printer object. You can provide the Combobox (or Listbox) with available printers:
Code:
Dim prn As Printer
For Each prn In Printers
Combo1.AddItem prn.DeviceName
Next
Then after the user selects the printer, you can use it to print:
Code:
Dim prn As Printer
For Each prn In Printers
If prn.DeviceName = Combo1.Text Then
prn.Print "This is a printer demo"
prn.EndDoc
Exit For
End If
Next