[python-win32] Re: Automating IE

Thomas Heller theller at python.net
Thu Feb 26 04:52:50 EST 2004


[Tim]
>>> Example:
>>>
>>> "c:\program files\adobe\Acrobat 4.0\Reader\acrord32.exe" /p doc.pdf
>>>
>>
[Thomas]
>>Or, call ShellExecute directly.
>>
>>from ctypes import *
>>windll.shell32.ShellExecuteA(None, "print", "doc.pdf", None, None, 0)
>>
>>See also:
>><http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/shellexecute.asp>
[Tim]
>
> Funnily enough, I had that same idea about 10 seconds after I
>  sent the email, but decided not to clutter the list up with
>  more of my ramblings.
> Oops. I've done it anyway.

If ctypes wouldn't have been invented, I would propose that
os.startfile(path) should take an optional second argument allowing to
specify 'open', 'print', or whatever.

Thomas




More information about the Python-win32 mailing list