Word/VBA Printing - Windows API

MonteDelMar used Ask the Experts™
I need to be able to set various printer settings via VBA when printing from Word e.g. duplex, hole punch, stapling, stapling and hole punch etc.  My preferred method to date is to set up multiple versions of printers.  However, I know that it is possible to set duplex via the Win API.  Is it possible to manipulate stapling etc. too?  Do you think the Win API is the way to go or would you recommend setting up multiple printers and if so, why?
Thank you very much for your help/comments.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Applications Administrator
Take a look at the code in the attached template.  We use this to set printer trays & duplexing and such.  I think it is what you need.
Lee OsborneSenior Infrastructure Engineer
We use the same code adapted from http://pubs.logicalexpressions.com/pub0009/LPMArticle.asp?ID=116 too.



Thank you both very much.  I have found how to set the staple option on/off.  Do you know how to set the hole punch option?
Stacy BrownSenior Applications Administrator

Sorry, I don't know.
Hi MoteDelMar,
I have the same problem you had. Can you please let me know what the solution was for stapling. I did not see it in the solutions identified above.


I am sorry, I cannot find this for the moment.  I am 98% sure I saw it somewhere and will need to find it soon myself.  I will post it here when I do.  In the meantime, one way of doing would be to have another version of the printer installed with the stapling option permanently on.  I think this might be how I will have to deal with the hole punch option.  For example:

Printer1 (regular version of the printer)
Printer1_S (same printer permanently set to staple)
Printer1_HP (same printer permanently set to hole punch)
Printer1_SHP (same printer permanently set to staple & hole punch)

You can then use the code method (DM_Duplex) to set any of these printers to print duplex as required.

Hope that helps.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial