driving Internet Explorer with Python

Neil Hodgson neilh at scintilla.org
Thu Apr 5 08:42:40 EDT 2001


Alex Martelli:
> "Neil Hodgson" <neilh at scintilla.org> wrote in message
>     [snip]
> >    Scripting IE is a /huge/ topic. I had a look and couldn't find a way
to
> > print to a particular device.
>
> I think you just need to win32print.SetDefaultPrinter('whatever'),
> then use the .ExecWB method with the don't-prompt-user option (I
> have not tested this).

   Looking up SetDefaultPrinter in MSDN gives two areas of information, one
on the wshNetwork object and one on munging WIN.INI. It looks like the
win32print module is a front end to wshNetwork or something cleverer has
been done underneath. If it is the wshNetwork object then MSDN says the
argument is the 'Remote printer name to set as default, such as
"\\Server\Printer1". Note that strPrinterName cannot be a local name such as
"LPT1:". '

   Neil






More information about the Python-list mailing list