Ensuring the contacts in a Distribution List are displayed with both name and email address

Posted by hawbsl on Stack Overflow See other posts from Stack Overflow or by hawbsl
Published on 2010-05-05T14:06:55Z Indexed on 2010/05/05 18:08 UTC
Read the original article Hit count: 271

How can I ensure the contacts I add to an Outlook distribution list are displayed with both name and email address? These contacts may not exist in any other address book, just the distribution list. Currently they show up just as an email address (in both columns).

alt text

Here's roughly the VBA we're using:

    Do Until RS.EOF

        //here's where we want to inject RS!FirstName, RS!Surname etc
        objRecipients.Add RS!Email
        objRecipients.Resolve

        RS.MoveNext
    Loop


    Set objDistList = contactsFolder.Items.Add("IPM.DistList")
    objDistList.DLName = "Whatever"

    objDistList.AddMembers objRecipients
    objDistList.Save

    etc

© Stack Overflow or respective owner

Related posts about vba

Related posts about outlook