Outlook VBA-检索电子邮件地址的显示名称的功能 [英] Outlook VBA - Function to retrieve Display Name of an email address
问题描述
在没有任何代码的情况下道歉,我只是不知道如何开始.
Apologize as I come up without any code, I just simply don't know how to start.
所以说我有一个电子邮件地址.我想检查此电子邮件地址是否属于我的Outlook的任何联系人文件夹或任何通讯簿中的任何联系人.如果是,我想检索该电子邮件地址的关联显示名称.我需要足够快的功能来检查一长串的电子邮件地址.
So let say I have an email address. I want to check whether this email address belongs to any contact in any contact folder or in any address book of my Outlook. If yes, I want to retrieve the associate Display Name of the email address. I need the function fast enough to check long list of email addresses.
希望有人可以提供帮助.谢谢.
Hope somebody can help. Thanks.
推荐答案
尝试调用Namespace.CreateRecipient
/Recipient.Resolve
,然后读取Recipient.Name
属性.请注意,它不是唯一的.
Try to call Namespace.CreateRecipient
/ Recipient.Resolve
, then read Recipient.Name
property. Note that it is not unique.
如果需要解析多个条目,请创建一条临时消息,然后将值添加到MailItem.Recipients
集合中,调用Recipients.ResolveAll
.
If you need to resolve multiple entries, create a temporary message, add the values to the MailItem.Recipients
collection, call Recipients.ResolveAll
.
这篇关于Outlook VBA-检索电子邮件地址的显示名称的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!