2
votes

Does anyone know how to search the Global Address Book on the exchange server? It seems the 'Address Book' is different to a public contact list, hence this popular example code (or similar) points to a completely different set of contacts:

Outlook.Application app = new Outlook.Application();
Outlook._NameSpace olNS = app.GetNamespace("MAPI");
Outlook._Folders oFolders = olNS.Folders;
Outlook.MAPIFolder oContactsFolder = olNS.Folders["Public Folders"].Folders["All Public Folders"].Folders["Contacts"];

I need to search for a specific contact name. PS:- I'm using outlook 2007. Many Thanks...

2

2 Answers

0
votes

If you are online a call using ADSI would be the way to go, offline you are in looking at extended mapi there is an answer to that here on SO using redemption.

0
votes

The process is very tedious and error prone. I think you may find the bellow article at Add-In Express useful:

HowTo: Convert Exchange-based email address into SMTP email address

I think it doesn't need their tools in order to work but I am not quite sure as I had them when I tried it. The code is in VB but they have a sample project available for download in C# if you prefer. It is rather long and has lots of COM object calls, so experience with that will be necessary. Also I am not quite sure if it will work on the 64 bit version of Outlook. Maybe you want to try this first.