How to print a duplex page and have the printer go back to defaultsetting

T

Tonya Marshall

At work we have an HP Laserjet 2300dtn which can duplex print. We have
to manually set it for the duplex printing and then when through, have
to go back and change it to the default setting as it retains the last
setting. We print more than one of the document we are duplexing and
there is no consistent amount. It depends on the number of staff for
that shift (3 shifts).

Is there a way that the duplex/default settings can be automatically
done without having to go back to the printer settings?

Cross-posted to printingfonts & vba.beginners
 
T

Tonya Marshall

Thanks, Jonathan. I sent myself the link at work and will post back
about how it worked, etc.
Tonya Marshall
 
T

Tonya Marshall

When I run the macro I get a compile error: Sub or Function not
defined and it highlights "SetDuplex" 3
These are the choices for the printer:
Default Print Settings
Duplex
Duplex - 180

Tonya Marshall
 
J

Jonathan West

You need to include all the code at the end of the article as well as the
small code sample near the start
 
T

Tonya Marshall

OK. I'm at home and don't have a duplex printer to test it on but wanted
to check and make sure I did it right. I created a template and put in
the printduplexbooklet macro which went into the NewMacros module and
put a button on a toolbar I named duplex..

I created Module1 into which I copied and pasted the code at the end of
the article. I've never created another module within VB so am checking
if I did it right. I right-clicked on the modules folder/insert/module
and it came out named Module1. I will send the template to work and
test it out tomorrow barring any warnings or "don't do that" from you.

Tonya Marshall
 
J

Jonathan West

Tonya Marshall said:
OK. I'm at home and don't have a duplex printer to test it on but wanted
to check and make sure I did it right. I created a template and put in
the printduplexbooklet macro which went into the NewMacros module and put
a button on a toolbar I named duplex..

I created Module1 into which I copied and pasted the code at the end of
the article. I've never created another module within VB so am checking
if I did it right. I right-clicked on the modules folder/insert/module
and it came out named Module1. I will send the template to work and test
it out tomorrow barring any warnings or "don't do that" from you.

Yes, that sounds right.
 
T

Tonya Marshall

OK, at work now and tested it. It worked fine but I was unable to
choose how many copies I wanted. We print several of the documents at
one time and need to be able to control that part of it, too.
 
J

Jonathan West

Tonya Marshall said:
OK, at work now and tested it. It worked fine but I was unable to
choose how many copies I wanted. We print several of the documents at
one time and need to be able to control that part of it, too.

You can change this line

ActiveDocument.PrintOut Background:=False

to this

Dialogs(wdDialogFilePrint).Show

This will display the print dialog so that the user can choose how many
copies are printed.

Alternatively, you can simply set the Copies parameter of the PrintOut
method to the appropriate value, like this

ActiveDocument.PrintOut Background:=False, Copies:=3
 
T

Tonya Marshall

I chose the first option as it's not a static amount. Jonathan, those
macros must have taken a lot of thought and time to write. I am so
pleased with the results - it worked smoothly without any hitches and I
truly appreciate what you have done. Thank you so much for walking me
through all of that, and I had the easy part to do. Just copy and paste.

As I said in a previous post, I had never worked with modules and I had
a kind of Aha! moment there. Speculation and multiple possibilities
about modules have been swirling around so I'm going to start a new
subject about modules as I have a lot of questions.

Thank you again for all your help and macros.

Tonya Marshall
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top