Use printer in Word without changing default?

Stu Dapples

Active Member
Joined
Jan 12, 2009
Messages
252
Hi guys!

I have written a bit of code to capture some info which is then printed ona Dymo label printer. I have all the user form working OK, it prints to the Dymo fine....

Problem is, by using the code

application.activeprinter = "DYMO LabelWriter 450"

Application.Printout

Debug.Print Application.ActivePrinter

It changes the Windows default printer to the Dymo! This is not good as someone will, sooner or later, send an A3 document to it and use a roll of labels!! :laugh:

Is there a way to slect the printer temporarily but not change the windows default?

Been searching but getting near to hair tearing now!

In anticipation,

Stu
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I registered for the sole purpose of issuing a bump! Ideally, one would use a variable to store the current active printer, change to the LabelWriter, print the job, then revert to the originally active printer. It's entirely possible that you found the answer to this elsewhere, but I'm still looking. No hair-tearing, though...
 
Upvote 0
That's how I'd do it...

Code:
CurrentPrinter = Application.ActivePrinter
Application.ActivePrinter = "DYMO LabelWriter 450"
Application.Printout
Application.ActivePrinter = CurrentPrinter
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top