Getting the representative email address of a distribution list












1















How do I get the representative email address of a distribution list (NOT the email addresses of each member in the list)?
Please refer to the following pseudo code.



Your kind help would be appreciated.



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









share|improve this question

























  • What do you mean by "representative email address of a distribution list". The address of the DL itself?

    – Dmitry Streblechenko
    Nov 23 '18 at 3:01











  • Yes, the email address of the DL itself. The DL has an email address assigned to it just like a regular SMTP address. Recip_email is an SMTP address. Refer to Recip_email in the code.

    – Barok
    Nov 23 '18 at 4:31













  • Have you checked this link: stackoverflow.com/questions/10637729/…

    – Alina Li
    Nov 23 '18 at 7:59
















1















How do I get the representative email address of a distribution list (NOT the email addresses of each member in the list)?
Please refer to the following pseudo code.



Your kind help would be appreciated.



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









share|improve this question

























  • What do you mean by "representative email address of a distribution list". The address of the DL itself?

    – Dmitry Streblechenko
    Nov 23 '18 at 3:01











  • Yes, the email address of the DL itself. The DL has an email address assigned to it just like a regular SMTP address. Recip_email is an SMTP address. Refer to Recip_email in the code.

    – Barok
    Nov 23 '18 at 4:31













  • Have you checked this link: stackoverflow.com/questions/10637729/…

    – Alina Li
    Nov 23 '18 at 7:59














1












1








1








How do I get the representative email address of a distribution list (NOT the email addresses of each member in the list)?
Please refer to the following pseudo code.



Your kind help would be appreciated.



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









share|improve this question
















How do I get the representative email address of a distribution list (NOT the email addresses of each member in the list)?
Please refer to the following pseudo code.



Your kind help would be appreciated.



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






vba list email outlook contacts






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 4:39







Barok

















asked Nov 23 '18 at 1:59









BarokBarok

508




508













  • What do you mean by "representative email address of a distribution list". The address of the DL itself?

    – Dmitry Streblechenko
    Nov 23 '18 at 3:01











  • Yes, the email address of the DL itself. The DL has an email address assigned to it just like a regular SMTP address. Recip_email is an SMTP address. Refer to Recip_email in the code.

    – Barok
    Nov 23 '18 at 4:31













  • Have you checked this link: stackoverflow.com/questions/10637729/…

    – Alina Li
    Nov 23 '18 at 7:59



















  • What do you mean by "representative email address of a distribution list". The address of the DL itself?

    – Dmitry Streblechenko
    Nov 23 '18 at 3:01











  • Yes, the email address of the DL itself. The DL has an email address assigned to it just like a regular SMTP address. Recip_email is an SMTP address. Refer to Recip_email in the code.

    – Barok
    Nov 23 '18 at 4:31













  • Have you checked this link: stackoverflow.com/questions/10637729/…

    – Alina Li
    Nov 23 '18 at 7:59

















What do you mean by "representative email address of a distribution list". The address of the DL itself?

– Dmitry Streblechenko
Nov 23 '18 at 3:01





What do you mean by "representative email address of a distribution list". The address of the DL itself?

– Dmitry Streblechenko
Nov 23 '18 at 3:01













Yes, the email address of the DL itself. The DL has an email address assigned to it just like a regular SMTP address. Recip_email is an SMTP address. Refer to Recip_email in the code.

– Barok
Nov 23 '18 at 4:31







Yes, the email address of the DL itself. The DL has an email address assigned to it just like a regular SMTP address. Recip_email is an SMTP address. Refer to Recip_email in the code.

– Barok
Nov 23 '18 at 4:31















Have you checked this link: stackoverflow.com/questions/10637729/…

– Alina Li
Nov 23 '18 at 7:59





Have you checked this link: stackoverflow.com/questions/10637729/…

– Alina Li
Nov 23 '18 at 7:59












1 Answer
1






active

oldest

votes


















1














Use Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress.






share|improve this answer


























  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – user3473830
    Nov 24 '18 at 8:23






  • 1





    @user347383 this DOES provide an answer.

    – Dmitry Streblechenko
    Nov 25 '18 at 1:13











  • Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

    – Barok
    Nov 26 '18 at 1:50






  • 1





    @Barok - yes, sorry, I fixed the answer.

    – Dmitry Streblechenko
    Nov 26 '18 at 6:23











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53439828%2fgetting-the-representative-email-address-of-a-distribution-list%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Use Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress.






share|improve this answer


























  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – user3473830
    Nov 24 '18 at 8:23






  • 1





    @user347383 this DOES provide an answer.

    – Dmitry Streblechenko
    Nov 25 '18 at 1:13











  • Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

    – Barok
    Nov 26 '18 at 1:50






  • 1





    @Barok - yes, sorry, I fixed the answer.

    – Dmitry Streblechenko
    Nov 26 '18 at 6:23
















1














Use Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress.






share|improve this answer


























  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – user3473830
    Nov 24 '18 at 8:23






  • 1





    @user347383 this DOES provide an answer.

    – Dmitry Streblechenko
    Nov 25 '18 at 1:13











  • Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

    – Barok
    Nov 26 '18 at 1:50






  • 1





    @Barok - yes, sorry, I fixed the answer.

    – Dmitry Streblechenko
    Nov 26 '18 at 6:23














1












1








1







Use Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress.






share|improve this answer















Use Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 26 '18 at 6:23

























answered Nov 24 '18 at 2:22









Dmitry StreblechenkoDmitry Streblechenko

43.3k32760




43.3k32760













  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – user3473830
    Nov 24 '18 at 8:23






  • 1





    @user347383 this DOES provide an answer.

    – Dmitry Streblechenko
    Nov 25 '18 at 1:13











  • Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

    – Barok
    Nov 26 '18 at 1:50






  • 1





    @Barok - yes, sorry, I fixed the answer.

    – Dmitry Streblechenko
    Nov 26 '18 at 6:23



















  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

    – user3473830
    Nov 24 '18 at 8:23






  • 1





    @user347383 this DOES provide an answer.

    – Dmitry Streblechenko
    Nov 25 '18 at 1:13











  • Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

    – Barok
    Nov 26 '18 at 1:50






  • 1





    @Barok - yes, sorry, I fixed the answer.

    – Dmitry Streblechenko
    Nov 26 '18 at 6:23

















This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

– user3473830
Nov 24 '18 at 8:23





This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

– user3473830
Nov 24 '18 at 8:23




1




1





@user347383 this DOES provide an answer.

– Dmitry Streblechenko
Nov 25 '18 at 1:13





@user347383 this DOES provide an answer.

– Dmitry Streblechenko
Nov 25 '18 at 1:13













Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

– Barok
Nov 26 '18 at 1:50





Dmitry@ Thank you and it works fine. However, there seems to be a syntax error in your code: Recip.AddressEntry.GetExchangeDistributionList.PrimarySmtpAddress

– Barok
Nov 26 '18 at 1:50




1




1





@Barok - yes, sorry, I fixed the answer.

– Dmitry Streblechenko
Nov 26 '18 at 6:23





@Barok - yes, sorry, I fixed the answer.

– Dmitry Streblechenko
Nov 26 '18 at 6:23




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53439828%2fgetting-the-representative-email-address-of-a-distribution-list%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin