Convert Exchange email addresses to SMTP using the MAPI Store Accessor

Add-in Express™ Support Service
That's what is more important than anything else

Convert Exchange email addresses to SMTP using the MAPI Store Accessor
 
Jean-Philippe




Posts: 21
Joined: 2009-12-15
Hi,
As part of my Outlook plugin, I need to get the list of email addresses fr om the contact book. My issue is when I have to deal with Exchange contacts wh ere I'm having problems getting the corresponding SMTP email address.

I tried using the sample code http://www.add-in-express.com/creating-addins-blog/2009/05/08/outlook-exchange-email-address-smtp/. The sample itself works but when I integrated to my application to run on a seperate thread I get an error in the GetAddrBook() on the first call to MAPI.MAPIInitialize which returns -2147417850 while it works fine if I run it through the main module. But for performance issues (getting the Exchange address can be long), I can't run from the main thread.

Can you help me figure out what I'm doing wrong? Or Is there a way to use the MAPI Store Accessor to convert the Exchange email instead?
Posted 15 Dec, 2009 10:19:10 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Jean-Philippe,

Can you help me figure out what I'm doing wrong?


You just need to run the code in the main thread.

Or Is there a way to use the MAPI Store Accessor to convert the Exchange email instead?


No, there is not.
.NET, Extended MAPI, Windows Phone & RT
Posted 15 Dec, 2009 10:36:52 Top
Jean-Philippe




Posts: 21
Joined: 2009-12-15
Thanks Eugene for the quick answer. Save me a lot of time.
Posted 15 Dec, 2009 10:45:13 Top