[python-win32] win32com.client.Dispatch("MAPI.Session") error exchange 2003

Adnan Chowdhury adnan.chowdhury at gmail.com
Mon Nov 14 04:45:20 CET 2005


I'm trying to connect to an Exchange 2003 server win ActiveState's
python implementation 2.4.1.

When I run the following code:
import win32com.client
session = win32com.client.Dispatch ("MAPI.Session")
session.Logon (ProfileName="Adnan Chowdhury")

I get this error:
Traceback (most recent call last):
  File "MAPI Test.py", line 3, in ?
    session = win32com.client.Dispatch ("MAPI.Session")
  File "C:\Python24\Lib\site-packages\win32com\client\__init__.py",
line 95, in Dispatch
    dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
line 91, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
line 79, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

Is there something more that I need to define?


More information about the Python-win32 mailing list