[python-win32] getting global addressbook with extended mapi
Jürgen Kareta
python at kareta.de
Mon Jun 6 16:50:22 CEST 2005
Hello,
I followed Marks hint and tried to get my global addressbook entries
with extended mapi.
from win32com.mapi import mapiutil
from win32com.mapi import exchange
import pprint,pythoncom
profileName = "Test"
session = mapi.MAPIInitialize(None)
session =mapi.MAPILogonEx(0,'test',None, mapi.MAPI_EXTENDED |
mapi.MAPI_LOGON_UI |\
mapi.MAPI_NO_MAIL |mapi.MAPI_USE_DEFAULT)
hr=session.OpenAddressBook(0,None,mapi.AB_NO_DIALOG)
gal = exchange.HrFindExchangeGlobalAddressList (hr)
raise:
gal = exchange.HrFindExchangeGlobalAddressList (hr)
NotImplementedError: Not available with this version of the Exchange SDK
So it seems to be that our exchange5.5 SP3 Server don't provide all
extended mapi features. But the
DumpTopLevelFolders funktion of the class MAPIDriver in spambayes
sandbox works fine.
How can I find a workaround to access the gal entries ?
The final solution should work like the following cdo code:
from win32com.client.dynamic import Dispatch
s=Dispatch("Mapi.session")
s.Logon("", "", False, True, 0, True,\
ProfileInfo="/o=myserver/ou=myside/cn=Configuration/cn=myserver\n\nanon")
entries=s.AddressLists('Globales Adressbuch').AddressEntries.Item(my
distribution list).Members
for entr in entries:
print entr.Name,entr.Fields(0x39fe001e).Value,entr.Fields(0x3a00001e)
Any hints ?
regards,
Jürgen
More information about the Python-win32
mailing list