[python-win32] Re: Question about printing through IE

Roger Upole rwupole at msn.com
Thu Mar 30 10:54:59 CEST 2006


Jason Robinson wrote:

>   Hi,
> 
> Being relatively new to Python (and no advanced programmer anyhow) I have a
> question..
> 
> For a work related program I need my Python script to be able to change
> printer settings in IE before printing. I have a script which creates an
> HTML file with images and text and it uses the ShellExecute approach to
> print it to a printer (using IE obviously). Only problem is I need it to
> access the IE printing settings directly and modify them before printing
> (margins etc etc). I've searched the web throughout but can't figure out
> where to start...
> 
> Any hints on what I should do?
> 
> Cheers for any help!

IE stores printing parameters in the registry at
HKCU\Software\Microsoft\Internet Explorer\PageSetup.
For options not covered there, you can use functions in
the win32print module to change your default printer settings,
but they'll apply to anything you print, not just IE.

      hth
           Roger



More information about the Python-win32 mailing list