简体   繁体   English

如何从GAL(全局地址列表)中获取addressEntry对象的完全匹配

[英]How to fetch exact match of addressEntry object from GAL (Global Address List)

I want to search for an addressEntry object in global address list using below code in C#. 我想在C#中使用以下代码在全局地址列表中搜索addressEntry对象。

 Microsoft.Office.Interop.Outlook.Application app = new Outlook.Application(); Outlook.AddressList gal = app.Session.GetGlobalAddressList(); Outlook.AddressEntry entry = gal.AddressEntries[name]; 

But i got the 1st matched name which is not correct. 但是我得到了第一个匹配的名字,这是不正确的。 I want to pass alias or primarySMTPAddress(mailId) as index which is unique . 我想传递别名或primarySMTPAddress(mailId)作为唯一的 索引 Give me the method to pass unique value to get exact addressEntry Object. 给我方法传递唯一值以获取确切的addressEntry对象。 Else method to fetch all the matching addressEntry objects. 其他方法来获取所有匹配的addressEntry对象。

And you can suggest the possible index parameters for below snippet. 您还可以为以下代码段建议可能的索引参数。

 Outlook.AddressEntry entry = gal.AddressEntries[name]; 

You need to iterate over all items to find the exact match. 您需要遍历所有项目以找到完全匹配的项目。 The Outlook object model doesn't provide any method or property for that. Outlook对象模型不为此提供任何方法或属性。

Using a low-level code (Extended MAPI) as Dmitry suggested you can create a RES_PROPERTY restriction on PR_ANR and call IMAPITable::Restrict on the contents table of the corresponding IABContainer object. 建议使用低级代码(扩展MAPI)作为Dmitry,您可以在PR_ANR上创建RES_PROPERTY限制,并在相应IABContainer对象的内容表上调用IMAPITable :: Restrict。 This is the same restriction used by Outlook when it resolves a name against a particular container and shows an ambiguous name dialog. 这与Outlook在针对特定容器解析名称并显示模糊的名称对话框时使用的限制相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从全局地址列表MSDN收集AddressEntry对象 - Collection of AddressEntry object from Global Address List MSDN 如何从具有邮箱地址的String中检索Outlook.AddressEntry对象? - How to retrieve Outlook.AddressEntry object from String with the mailbox address? 使用ExchangeService从Exchange Server 2010 SP1获取全局地址列表(GAL) - Get Global Address List (GAL) from Exchange Server 2010 SP1 using ExchangeService 允许全局地址列表(GAL)集成的ASP.NET控件 - Control for ASP.NET that allows Global Address List (GAL) integration 如何将DL邮件地址分配给Outlook.AddressEntry对象到GetExchangeDistributionListMembers? - How to assign DL mail address to Outlook.AddressEntry object to GetExchangeDistributionListMembers? 通过Exchange Web服务(EWS)erreor SSL查询全局地址列表(GAL) - Querying the Global Address List (GAL) via Exchange Web Services (EWS) erreor SSL 从Outlook中的多个帐户获取非默认通讯簿的GAL - To get GAL of non default address book from multiple accounts in outlook 如何使用 c# 从全局地址列表中获取联系人 - How to get contacts from Global Address List using c# 正则表达式从列表中查找完全匹配 - Regex Finding Exact Match from List 在 lucene.net 中检查并获取完全匹配 - Check and fetch the exact match in lucene.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM