I want to add support for searching for local Outlook contacts to my ATL/WTL app. Does anyone know of the Outlook COM interface (Office 2003 or greater) allows you to search for contacts? I already have LDAP lookup support but users want to be able to search their private contacts as well.
Any information would be welcome.
To get access to the contacts you first have to get a Namespace object using the Application's GetNamespace function, passing "MAPI" as the namespace name.
Then you use Namespace's GetDefaultFolder function, which gives you a MAPIFolder interface which contains an Items property.
Next you call the Find function on the items.
You must use MAPI to get access
Here you can find a MAPI wrapper
http://www.codeproject.com/KB/IP/CMapiEx.aspx
Also you should use Outlookspy, its very useful Add-on to show you most of MAPI interfaces and Outlook Object Model
You should read more about MAPI functions from MSDN
http://msdn.microsoft.com/en-us/library/aa142548(EXCHG.65).aspx