获取通讯组列表的代表电子邮件地址

时间:2018-11-23 01:59:08

标签: vba list email outlook contacts

如何获取通讯组列表的代表电子邮件地址(而不是列表中每个成员的电子邮件地址)? 请参考以下伪代码。

您的帮助将不胜感激。

Dim Recip As Outlook.Recipient
Dim Recip_email As String

If Recip.AddressEntry.AddressEntryUserType = olExchangeUserAddressEntry Then
    Recip_email = Recip.AddressEntry.GetExchangeUser.PrimarySmtpAddress
ElseIf Recip.AddressEntry.AddressEntryUserType = olSmtpAddressEntry Then
    Recip_email = Recip.Address
ElseIf Recip.AddressEntry.AddressEntryUserType = olExchangeDistributionListAddressEntry Then
    ' Recip that is a distribution list seems to fall in this branch
    ' How do I get the representative email address of the group?
    ' Example: if the representing email address is aaa@aaa.com, Recip_email = aaa@aaa.com

    Recip_email = ??????????????????????

Else
    Recip_email = vbNullString
End If

1 个答案:

答案 0 :(得分:1)

使用Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress