-
I have a label-printing program that I want to print to a non-default printer. Each label is printed using "PrintForm". I do not want my user to have to change the setting for the default printer each time she needs to print a label.
What is the simplest way to change the printer in code?
Thanks in advance.
-
You can enumarate the printers collection until you find the correct printer. Then you set the printer object to that printer.
Code:
Dim myPrinter As Printer
For Each myPrinter In Printers
If myPrinter.DeviceName = "the name of the device you want" Then
Set Printer = myPrinter
End If
Next
-
This looks promising - I'll give it a try
Thanks Iain (with an i!)
-
Yep - It worked perfectly and my labels user is now delighted that she doesn't have to keep switching the default printer.
You have helped me win 1 million brownie points!!!
-
The pleasure was all mine. ;)
-
Printer
Thanks,
I just used that bit of code. Works great.
Keep up the good work.