Search Outlook Contact using COM?

a 夏天 提交于 2019-12-23 03:11:09

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/811974/search-outlook-contact-using-com

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!