【发布时间】:2019-04-25 15:52:11
【问题描述】:
如何获取分发列表的代表电子邮件地址(不是列表中每个成员的电子邮件地址)? 请参考以下伪代码。
您的帮助将不胜感激。
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
【问题讨论】:
-
“分发列表的代表电子邮件地址”是什么意思。 DL 本身的地址?
-
是的,DL 本身的电子邮件地址。 DL 有一个分配给它的电子邮件地址,就像一个常规的 SMTP 地址一样。 Recip_email 是一个 SMTP 地址。参考代码中的 Recip_email。
-
你检查过这个链接吗:stackoverflow.com/questions/10637729/…
标签: vba list email outlook contacts