I'm trying to pull some properties from an Outlook.ExchangeUser object using VBA. I can pull most of what I need, except some data that seems to be stored using the Exchange extended attributes
Questions:
- Is it possible to pull the extended attributes using VBA?
- If so, how?
Here is some code to give an idea on what I'm doing (this is VBA code in a Microsoft Excel file):
...
Dim myOlApp As Outlook.Application
Dim addrList As AddressList
Dim exchUser As Oulook.ExchangeUser
...
Set myOlApp = CreateObject("Outlook.Application")
Set addrList = myOlApp.GetNamespace("MAPI").addressLists("SOMELIST")
Set exchUser = addrList.addressEntries("doe, john").GetExchangeUser
...
I can then pull the properties using the Exchange user object. I.e...
MsgBox ("User company name: " + exchUser.CompanyName)
If I try to do something like the above to pull the Extended attributes, I get an error like "Object doesn't support this property or method". I have tried the following to no avail:
exchUser.msExchangeAttributeX '(where X is a number from 1-15)
exchUser.ms-Exch-Extension-Attribute-X
exchUser.CustomAttributeX
exchUser.ExtensionCustomAttributeX
I also tried using a PropertyAccessor...
exchUser.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x802D001E")
I got the schema from here but I'm not positive that is correct. I do NOT get an error when I try that, it just comes back empty (nothing is pulled). I tried looking for a list of property tags so I could try others, but I can't seem to find them. If someone knows where to get those maybe that can help too.
Any help is appreciated. Thanks!