验证电子邮件地址是否在 Outlook 全局地址簿中

Validate if email address is in the Outlook global address book

我有一个单元格 (C4),用户将在其中输入他们的电子邮件地址。我想查看邮箱地址是否在Outlook的全局地址簿中。

如果存在,名称将输出到单元格(C5) - 名字和姓氏的组合,如果不存在,将抛出错误消息。

您可以通过 Excel VBA 宏自动执行 Outlook 以完成工作。 Automating Outlook from a Visual Basic Application 文章可以帮助您设置一切,运行。

使用 NameSpace.CreateRecipient method which creates a Recipient object. By using the following sequence of property and method calls you may get a corresponding ContactItem 对象,您可以在其中检索所有需要的信息:

recipient.AddressEntry.GetContact()