I have an Outlook 2007 add-in that adds information to calendar items. I'm running into a problem where if an old Calendar Invite is opened containing Exchange users that are no longer valid, Outlook hangs for around 90 seconds trying to lookup the contact. (Outlook is running in Cached Mode in this case)
I'm trying to figure out if there's a way to access an Exchange user's email asynchronously, or to detect that the user is removed, and simply ski开发者_开发技巧p it. Basically, anything to stop the UI from hanging for a whole minute and a half.
AddressEntry ae = appointmentItem.Recipients[0];
ExchangeUser eu = ae.GetExchangeUser();//hangs here if user is not in cached address book
I'd try to use the Redemption library with RDO to access the property and see how it reacts in this case. See http://www.dimastr.com/redemption/ and look for "RDORecipients object collection".
Redemption is never a bad idea - it's a very good library.
Another option is to call the GetExchangeuser() on another thread. This would avoid the blocking. Of course, you need to figure what to do in this case - show a "Please wait" dialog or let the user do something else during the duration of the call.
精彩评论