[python-win32] MAPI, windows service and getting handle to executing outlook process

Amrit Jassal ajassal at gmail.com
Mon Jan 30 22:59:19 CET 2006


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/20060130/8d235202/attachment.html 


More information about the Python-win32 mailing list