Hi Greg,
On 1:59 PM, Roberts, Gregory (Contractor) wrote:
We have decided to oset the default printer in a macro which we must run
on the excel report and hope that all will work on Monday when in
production.
I would like to find a python solution which I could refactor into the
correct place. Again, my wits with Python still have not formed.
Also... I am unable to dedicate to much time to this task for the time
being.
Thanks for the suggestions. I will try and think outside the box using
them as guidance.
Greg
I'm not sure why the other PyWin32 guys didn't mention this, but you can
do either of the following:
import win32print
win32print.SetDefaultPrinter('My Printer Name')
import subprocess
subprocess.call(r'rundll32 printui.dll PrintUIEntry /y /n\\UNC\path\to\printer')
I have a couple of other tips here:
http://www.blog.pythonlibrary.org/2010/02/14/python-windows-and-printers/
and Tim Golden's site has at least one other script based on printers:
http://timgolden.me.uk/python/wmi/cookbook.html#show-print-jobs
(although it has nothing to do with what you're doing).
The other guys had good suggestions too though.
--
*Mike Driscoll*
Blog: http://blog.pythonlibrary.org
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32