I am trying to write a script in Python that will pull the contact information from the Outlook Global Address List. For each entry, I've managed to get the name of the contact, as well as the alias (with some additional parsing).
My code is posted below:
import win32com.client
o = win32com.client.gencache.EnsureDispatch("Outlook.Application")
ns = o.GetNamespace("MAPI")
adrLi = ns.AddressLists.Item("Global Address List")
contacts = adrLi.AddressEntries
numEntries = adrLi.AddressEntries.Count
nameAliasDict = {}
for i in contacts:
name = i.Name
alias = i.Address.split("=")[-1]
nameAliasDict[alias] = name
print "\nThe global address list contains",numEntries,"entries."
Is there a way I can get the full set of information that shows up when I open the GAL in Outlook (such as Title, Email Address)?
Thanks.