[Tutor] Default printer in Windows

dfinner@Kollsman.com dfinner@Kollsman.com
Tue, 8 Oct 2002 14:55:31 -0400


I'm new to Python, but have spent some time playing with printer assignments in
Lotus Notes.  If this helps, great.  If Python has some extra magic it can do,
even better!

The printer belongs to the OS so anything you want to do with various printer
settings has to be done through the Windows API; finding and setting default
printers, switching between landscape and portrait, etc.

There are several API sites that provide useful information about these
functions along with some pointers at a Notes discussion forum for things like
switching orientation and selecting printers.  From what little I have seen
about the Python Win32 stuff, you should be able to adopt much of this code into
the Python environment.

Caveat - there was a ton of discussion about accessing printers as a function of
the OS.  Win 9x was a no brainer, WinNT/2000/etc. had issues associated with the
login rights of the person on the workstation.  The consensus was that printer
stuff (on WinNT/2000) belonged to the admin account and was, therefore,
unavailable to the login person.  A recent addition to this thread seemed to
indicate this wasn't necessarily true.  I'm not sure how it's all playing out,
just a word of caution.

Hope this helps.

Doug

Windows API and VB Reference:
http://www.vbapi.com/index.html
http://www.allapi.net/
http://freevbcode.com/default.asp
http://www.mvps.org/vbnet/
http://www.vb-world.net/
http://msdn.microsoft.com/library/default.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbidxkeycodeconstants.asp

 (VB Constants)

Printer Orientation:
http://www.notes.net/46dom.nsf/8fcda5a283f280b2852565590071d8af/c96d8f6be24082b98525693a0045e7a9!OpenDocument
http://www.notes.net/46dom.nsf/8fcda5a283f280b2852565590071d8af/88a79bd38a4fb8748525693b00411460!OpenDocument
http://209.180.19.180/pub/jordan/   (current code by the developer)
http://www.notes.net/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/b376f26b8cbd9f1b8525694d004e24c3?OpenDocument
http://www.notes.net/46dom.nsf/DateAllThreadedweb/b94b0b2454de749285256b66005e053d?OpenDocument

(why NT/2K is a problem)
http://www-10.lotus.com/ldd/46dom.nsf/ShowMyTopicsAllFlatweb/cb1c2b82362d531980256c2a0059f3c8?OpenDocument

(maybe NT/2K is not a problem)

Printer Selection:
http://www.notes.net/46dom.nsf/434e319a66960d8385256857005cd97b/3CA7A2FDFDC519F1852567BA004B3253?OpenDocument
http://web6.notes.net/46dom.nsf/434e319a66960d8385256857005cd97b/BE12FD60BA537B2C852568C00007B383?OpenDocument