[python-win32] Automating IE

Shitiz Bansal shitizb at yahoo.com
Thu Feb 26 01:54:22 EST 2004


Hi,
Thanx, ur code worked out.
However it didnt solve my problem.
Actually I was trying to print a pdf file programatically and copied the following code from internet
 
from win32com.client import Dispatch
 ie = Dispatch('InternetExplorer.Application')
 ie.Visible = 1
ie.Navigate2('c:\\dscV1.pdf')
pdfViewer = ie.Document.embeds[0]
 pdfViewer.Print()

The code works, but the trouble is it opens up the printerdialog. I want the printing without any user intervention with preset print options.
Is there a way out?

Shitiz




Janez Jere <janez.jere at void.si> wrote:
try: 
ie.Navigate2(url, 1, "_BLANK")
i just copied from one of working scripts.
but i dont remember why there are two additional params
 
Janez
 
-----Original Message-----
From: python-win32-bounces+janez.jere=void.si at python.org [mailto:python-win32-bounces+janez.jere=void.si at python.org]On Behalf Of Shitiz Bansal
Sent: Wednesday, February 25, 2004 10:37 PM
To: python-win32 at python.org
Subject: [python-win32] Automating IE


Hi,
CAn anybody explain me teh reason for this error and how to correct it
 
from win32com.client import Dispatch
ie = Dispatch('InternetExplorer.Application')
ie.Visible = 1
ie.Navigate2('c:\\Civil.html')

Traceback (most recent call last):
  File "<pyshell#6>", line 1, in -toplevel-
    ie.Navigate2('C:\\Civil.html')
  File "<COMObject InternetExplorer.Application>", line 2, in Navigate2
com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None)
 
thanx in advance
 
shitiz


---------------------------------
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.


---------------------------------
Do you Yahoo!?
Get better spam protection with Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20040225/e94af981/attachment.html


More information about the Python-win32 mailing list