Searching Outlook Global Adress List

Posted by MoominTroll on Stack Overflow See other posts from Stack Overflow or by MoominTroll
Published on 2010-03-22T11:33:21Z Indexed on 2010/03/22 12:01 UTC
Read the original article Hit count: 333

Filed under:
|

I'm pulling up the Global Address List from Outlook like so...

 Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
 AddressList gal = oApp.Session.GetGlobalAddressList();

...with the aim of eventually being able to search through this in my own application to retrieve contact information which I can then supply to a method that squirrels off an email. Unfortunately given that my own GAL has about 20K entries in (the customers much more) using a foreach or something simply doesn't work in an acceptable timeframe.

I want to pass a string like "Tom" to a method and have it return a list of possible contacts. Is this possible outside of actually opening up Outlook and creating the mail there?

Note: There are a couple of other questions similar to this but most seem to have no good answer. I'm hoping I have more luck.

© Stack Overflow or respective owner

Related posts about c#

Related posts about globaladresslist