[python-win32] MAPI, windows service and getting handle to executing outlook process
Mark Hammond
mhammond at skippinet.com.au
Mon Jan 30 23:12:21 CET 2006
Try:
outlook=win32com.client.GetActiveObject("Outlook.Application")
Mark.
-----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of Amrit Jassal
Sent: Tuesday, 31 January 2006 8:59 AM
To: python-win32 at python.org
Subject: [python-win32] MAPI,windows service and getting handle to
executing outlook process
I am writing a mail extractor program to download mail from outlook via
MAPI. The script works fine as a console program and as an NT service if
outlook is not running.
If outlook process is running then the service times out with the
following exception:
File "win32com\client\__init__.pyc", line 95, in Dispatch
File "win32com\client\dynamic.pyc", line 91, in
_GetGoodDispatchAndUserName
File "win32com\client\dynamic.pyc", line 79, in _GetGoodDispatch
com_error: (-2146959355, 'Server execution failed', None, None)
at the line: outlook = win32com.client.Dispatch("Outlook.Application")
I see that there is a new OUTLOOK.EXE process created as well. Looks like
I need to get a handle to the executing process and not spawn a new one.
Anybody has faced this before and provide some pointers?
Thanks for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060131/40ae2eec/attachment.htm
More information about the Python-win32
mailing list