从 C# 搜索公共 Outlook 联系人文件夹
我们在 Outlook 中有一个名为“全局联系人”的大型公共联系人文件夹,我希望能够搜索它并返回一些符合特定条件(最好是通配符样式)的结果。
例如,如果有人在“姓名”文本框中输入“je”,它将返回姓名包含“je”的所有联系人。这可以作为 AND 与公司名称文本框耦合。
我见过的大多数示例要么是用 VB 编写的,要么是与将其形成为 Web 应用程序有关 - 我正在做一个 winforms 应用程序,并且每台计算机都安装了 Outlook 2002(是的,我知道,更新早就该进行了)。
有人能指出我正确的方向吗?一些代码可以作为一个很好的起点。
干杯
We have a large public contacts folder in Outlook called Global Contacts, I'd like to be able to search through it and return a number of results that match certain criteria, ideally wildcard-style.
E.g. if someone puts "je" in the 'name' textbox, it will return all contacts whose names contain 'je'. This may be coupled as an AND with a companyname textbox.
Most of the examples I've seen are either in VB, or are concerned with doing this form a web app - I'm doing a winforms app, and every machine has Outlook 2002 installed (yeah, I know, update long overdue).
Can anyone point me in the right direction? Some code would be nice as a place to start.
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最终这样做了:
然后只需循环 itmsFiltered 将其添加到 ObjectListView 中。希望这对其他想要做同样事情的人有用 - 我花了一段时间才从各种来源将其拼凑在一起。
I ended up doing this:
Then just looping through itmsFiltered to add it to an ObjectListView. Hopefully this will be of use to someone else looking to do the same - it took me a while to cobble this together from various sources.
要查找联系人文件夹,您可以迭代 olFolderContacts 的项目。这是代码
to find contacts folder you can iterate items of olFolderContacts. Here is the code