问题
From an AddressEntry instance I'm calling GetExchangeUser or GetExchangeDistributionList methods to get PrimarySmtpAddress
. This works fine when the AddressEntry
has a DisplayType
of olUser
or olDistList
, but both return null for an address with DisplayType
of olForum
.
The Exchange address does have an associated SMTP address. In Outlook I can type the address into "To" on a new email and it resolves to the appropriate Exchange user. Double-click on the user and an SMTP address does show. I just can't find a way to get to it through the Outlook object model.
回答1:
If the SMTP address is available on that address entry, you should be able to retrieve it using AddressEntry.PropetyAccessor.GetProperty.
Take a look at that address entry using OutlookSpy - if you already have a message with that GAL entry as one of the recipients, select it in Outlook, click IMessage button on the OutlookSpy ribbon, go to the GetRecipientTable tab, double click on the recipient.
Do you see PR_SMTP_ADDRESS property? How about PR_EMS_AB_PROXY_ADDRESSES?
来源:https://stackoverflow.com/questions/19443087/get-exchange-user-primarysmtpaddress-for-displaytype-olforum