从包含 FullNAme(如“姓名”)的代码中查找 Outlook 联系人
在 c# 中编写 Outlook 2010 AddIn
如何查找联系人,例如全名(如“姓名”)
首先我尝试过
string filter = "[FullName] = 'Name'";
,它工作正常,但仅适用于姓名,但现在我需要查找全名可以是 JonName 或 Peter Pen 或...的联系人
据我了解,我应该在过滤器中使用空间查询字符串,但是要写什么呢?
Outlook.MAPIFolder folderContacts;
Outlook.Items contactItems;
Outlook.ContactItem contact;
folderContacts = Globals.ThisAddIn.Application.ActiveExplorer().Session.
GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
contactItems = folderContacts.Items;
string filter = "What should I write here?";
var foundContacts = contactItems.Find(filter);
Writing Outlook 2010 AddIn in c#
How to find contacts where for example FullName like "Name"
First I tried
string filter = "[FullName] = 'Name'";
and it works fine but only for the Name, but now I need to find contacts where FullName can be JonName or Peter Pen or ...
As I uinderstood I should use spacial query string in filter, but what to write?
Outlook.MAPIFolder folderContacts;
Outlook.Items contactItems;
Outlook.ContactItem contact;
folderContacts = Globals.ThisAddIn.Application.ActiveExplorer().Session.
GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
contactItems = folderContacts.Items;
string filter = "What should I write here?";
var foundContacts = contactItems.Find(filter);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅文档。
不过,我强烈建议您使用 VSTO 电动工具 (免费下载) 代替;它们会让你的生活变得更加轻松。
See the documentation.
However, I highly recommend that you use the VSTO Power Tools (free download) instead; they will make your life much easier.