How do I create a distribution list from categorized contacts?

I have a large contacts folder and have added Categories for important contacts.  How do I use this subgrouping of categories to create distribution lists for emailing?  I don't want to have to go in and select members one at a time, I would like to create the list semi-automatically by just selecting the category.

If this can't be done, is there any other way to organize my address book for faster creation of distribution lists?

Bob
ba272Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi ba272,

You don't have to select them individually.  You can switch to the Category view, hilight a category, and select New Message to Contact.  It'll create a message addressed to all members of the category.  That's more efficient than having to create and maintain a distribution list for each category.  If you really want distribution lists instead, then I'm pretty confident that I can produce a macro that will build a dist list for a category.  Let me know how you want to proceed.

Cheers!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ba272Author Commented:
BlueDevilFab,

Thank you for the info.  I do need a little clarification, though.

1) I went to category view and see all the contacts listed.  But I could not figure out how to initiate a new message to Contact.  I tried right clicking the contacts.  I tried going to New Message-nut this required that I fill in the namesindividually.

Also, I would be interested in a macro to create distribution lists from categories.  Because I might then want ot edit so that I can keep track of what messages I send to what people-even if they are in the same categories.

Thanks for your help.

Bob
David LeeCommented:
Hi, Bob.

Once you've switched to Category view, click on the Category header.  For example, if you have a category called Business, then click on the line saying "Categories: Business (x items)".  Now, click the Actions menu and select New Message to Contact.

Ok, I'll get to work on the macro and get it posted as quickly as I can (probably sometime this evening).
ba272Author Commented:
Thanks!

Bob
David LeeCommented:
Bob,

Here's the macro.  I tested it using Outlook 2003 and it worked perfectly.  Let me know if you need instructions on setting up a macro.

Sub MakeCategoricalDistList()
    Dim colContacts As Outlook.MAPIFolder, _
        objDistList As Outlook.DistListItem, _
        objContact As Object, _
        objMessage As Outlook.MailItem, _
        colRecipients As Outlook.Recipients, _
        strCategory As String
    strCategory = InputBox("What category should I make a dist list for?", "Categorical Distribution List")
    If strCategory <> "" Then
        Set objMessage = Application.CreateItem(olMailItem)
        Set colRecipients = objMessage.Recipients
        Set colContacts = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)
        For Each objContact In colContacts.Items
            If objContact.Class = olContact Then
                If InStr(1, objContact.Categories, strCategory) > 0 Then
                    If objContact.Email1Address <> "" Then
                        objMessage.Recipients.Add objContact.Email1Address
                    End If
                End If
            End If
        Next
        colRecipients.ResolveAll
        Set objDistList = Application.CreateItem(olDistributionListItem)
        With objDistList
            .DLName = "DL-" & strCategory
            .Categories = strCategory
            .AddMembers colRecipients
            .Save
        End With
        MsgBox "Distribution list for Category '" & strCategory & "' created.", vbOKOnly, "Categorical Distribution List"
    End If
    Set objMessage = Nothing
    Set colRecipients = Nothing
    Set objContact = Nothing
    Set objDistList = Nothing
    Set colContacts = Nothing
End Sub

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.