I have a python program that does some things on Exchange mailboxes. I use the MAPI.Session object for this and create it like this:<br><br><br>PythonWin 2.4.2 (#67, Oct 30 2005, 16:11:18) [MSC v.1310 32 bit (Intel)] on win32.
<br>Portions Copyright 1994-2004 Mark Hammond (<a href="mailto:mhammond@skippinet.com.au">mhammond@skippinet.com.au</a>) - see 'Help/About PythonWin' for further copyright information.<br>>>> import win32com.client
<br>>>> MAPISession = win32com.client.Dispatch("MAPI.Session")<br>>>> MAPISession.Logon()<br>>>> for infostores in MAPISession.InfoStores:<br>... print infostores.Name<br>... <br>
Public Folders<br>Mailbox - Rudy Schockaert<br>>>> <br>----------------------<br><br>If I now use makepy to create a genpy for the CDO 1.21 library (MAPI.Session) I get the following result:<br><br>PythonWin 2.4.2
(#67, Oct 30 2005, 16:11:18) [MSC v.1310 32 bit (Intel)] on win32.<br>Portions Copyright 1994-2004 Mark Hammond (<a href="mailto:mhammond@skippinet.com.au">mhammond@skippinet.com.au</a>) - see 'Help/About PythonWin' for further copyright information.
<br>>>> import win32com.client<br>>>> MAPISession = win32com.client.Dispatch("MAPI.Session")<br>>>> MAPISession.Logon()<br>>>> for infostores in MAPISession.InfoStores:<br>... print
infostores.Name<br>... <br>Traceback (most recent call last):<br> File "<interactive input>", line 1, in ?<br> File "C:\Python24\lib\site-packages\win32com\gen_py\3FA7DEA7-6438-101B-ACC1-00AA00423326x0x1x21.py
", line 3039, in __getitem__<br> return self._get_good_object_(self._oleobj_.Invoke(*(21, LCID, 2, 1, item)), "Item")<br>com_error: (-2147352565, 'Invalid index.', None, None)<br><br>----------------------
<br>
<br>Am I doing something wrong? Forgetting something? Can someone explain this?<br><br>Thanks in advance,<br><br>Rudy<br><br><br clear="all"><br>