Search Outlook Contact using COM?

2019-06-07 04:56发布

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.

2条回答
一纸荒年 Trace。
2楼-- · 2019-06-07 05:30

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

查看更多
3楼-- · 2019-06-07 05:45

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.

查看更多
登录 后发表回答