到目前为止,这是我的代码:
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]
print i.GetExchangeUser().PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3A56101E")
我从以下位置获取财产:https ://msdn.microsoft.com/en-us/library/bb446002.aspx
但由于某些原因,我收到此错误:
pywintypes.com_error: (-2147352567, 'Exception occurred.', (4096, u'Microsoft Outlook', u'The property "http://schemas.microsoft.com/mapi/proptag/0x3A550003" is unknown or cannot be found.', None, 0, -2147221233), None)
我做错了吗?