使用COM搜索Outlook联系人? [英] Search Outlook Contact using COM?

查看:88
本文介绍了使用COM搜索Outlook联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加对我的ATL/WTL应用程序中搜索本地Outlook联系人的支持.是否有人知道Outlook COM界面(Office 2003或更高版本)允许您搜索联系人?我已经有了LDAP查找支持,但是用户也希望能够搜索其私人联系人.

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.

推荐答案

要获取对联系人的访问权限,您首先必须使用应用程序的GetNamespace函数(传递"MAPI"作为命名空间名称)获取Namespace对象.

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.

然后,使用命名空间的GetDefaultFolder函数,该函数为您提供一个包含Items属性的MAPIFolder接口.

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.

这篇关于使用COM搜索Outlook联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆