Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Sep 2002
    Location
    St-Bruno, Quebec, Canada
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Distribution lists (Outlook 2002)

    I have a distribution list in Excel; Most, but not all, of these email addresses are in Contacts. I have created a field in Contacts called distribution list and would like to know if there is a way to create a distribution list by somehow using this field and its given value of English or French. My list has over 800 addresses and is to be divided by language. It is too long long to retype all the addresses. If someone can help with this, or even let me know of a better way to go about this, I'd appreciate it. We've been at this for a couple of weeks now.
    <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

  2. #2
    Star Lounger
    Join Date
    Feb 2003
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribution lists (Outlook 2002)

    The tricky bit is usually "lining up" the entries in Excel with the Contacts, but from what you have said you don't need to do this. Am I right in understanding that you have a custom field in contacts with "English" or "French" as the values, and now you want to make 2 distribution lists - one with all the people with "English" etc etc. If so, here is some code: - change strCustomFieldName = "Language" to whatever your custom field is called, and create the (currently empty) DLs.

    Sub MakeDLs()

    'will prompt you if the DLs don't exist
    'NOTE: if there are items in the DL, that is OK - they will stay: it will merge new items in (so, no duplicates!), but it won't take any OUT
    'alternative - use RESTRICT (from ITEMS) - requires custom field exists in folder
    'assumes the relevent email address is in the Email1 slot (not email 2 or 3)


    Dim appOutlook As Outlook.Application
    Dim fldContacts As Outlook.MAPIFolder
    Dim nmeMAPI As Outlook.NameSpace
    Dim cntX As ContactItem
    Dim lngCounter As Long
    Dim dlTemp As Outlook.DistListItem
    Dim rcpt As Outlook.Recipient
    Dim strCustomFieldName As String

    Set appOutlook = Application
    Set nmeMAPI = appOutlook.GetNamespace("MAPI")
    Set fldContacts = nmeMAPI.GetDefaultFolder(olFolderContacts)

    strCustomFieldName = "Language"

    For lngCounter = 1 To fldContacts.Items.Count
    On Error Resume Next
    Set cntX = fldContacts.Items(lngCounter) 'fails if item not a contactitems
    Dim strTemp As String
    strTemp = cntX.UserProperties(strCustomFieldName).Value 'fails if custom prop doesn't exist
    If Err.Number <> 0 Then
    strTemp = vbNullString
    Err.Clear
    End If
    On Error GoTo 0
    If Len(strTemp) > 0 Then
    Set dlTemp = fldContacts.Items(strTemp) 'fails if dl has not been created
    Set rcpt = nmeMAPI.CreateRecipient(cntX.Email1DisplayName)
    rcpt.Resolve
    dlTemp.AddMember rcpt
    dlTemp.Save
    ' dlTemp.Display
    ' dlTemp.Close olSave
    End If
    strTemp = vbNullString
    Next

    Set dlTemp = Nothing
    Set rcpt = Nothing
    Set cntX = Nothing
    Set fldContacts = Nothing
    Set nmeMAPI = Nothing
    Set appOutlook = Nothing

    End Sub

  3. #3
    Lounger
    Join Date
    Sep 2002
    Location
    St-Bruno, Quebec, Canada
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribution lists (Outlook 2002)

    Wow! Looks complicated. I forwarded your response to my boss who is a lot better with these things than me. Could I do a sort or group, and put all the "distribution list: French" contacts together and then make the distribution list from there? Is there a maximum number of people that I can send the email to at once? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  4. #4
    Star Lounger
    Join Date
    Feb 2003
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribution lists (Outlook 2002)

    You can't drag and drop contacts into DLs (sob - hmmmm, maybe I could write some code to do that.... hmmmmm).
    Anyway, if you need to go lo-tech, I would sort em, and put all of one type in one folder, and all of the other in a different folder. Then manually create the DL, and select all the contacts in the folder in one fell swoop. Then get a coffee while Outlook does it for you.
    But the code is much nicer [img]/forums/images/smilies/smile.gif[/img]

  5. #5
    Lounger
    Join Date
    Sep 2002
    Location
    St-Bruno, Quebec, Canada
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Distribution lists (Outlook 2002)

    Now that sounds more my speed! If my boss and I have too much trouble with the code, I'll try your second solution. Thank you. I am working on the list now and I have 207 English and 444 French email addresses to which I have to send my newsletter. Can/should I send to that many people at once?
    <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •