|
-
Jul 31st, 2000, 08:06 AM
#1
Thread Starter
Lively Member
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.
-
Jul 31st, 2000, 08:14 AM
#2
Fanatic Member
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
Iain, thats with an i by the way!
-
Jul 31st, 2000, 09:10 AM
#3
Thread Starter
Lively Member
This looks promising - I'll give it a try
Thanks Iain (with an i!)
-
Jul 31st, 2000, 10:12 AM
#4
Thread Starter
Lively Member
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!!!
-
Jul 31st, 2000, 10:28 AM
#5
Fanatic Member
The pleasure was all mine.
Iain, thats with an i by the way!
-
Aug 1st, 2000, 08:58 AM
#6
Junior Member
Printer
Thanks,
I just used that bit of code. Works great.
Keep up the good work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|