Managing contact groups in Outlook can be a time-saver. That is, until you hit send and half your recipients bounce back with “email not found” errors. If you’ve ever dealt with outdated or invalid emails in your distribution lists, this guide is for you.
In this post, I’ll show you how to use a simple VBA macro. This macro will help you clean up your Outlook contact groups. It does this by removing non-resolvable email addresses. No more manual checking, no more guesswork.
Why This Matters
Outlook doesn’t automatically verify whether the email addresses in your contact groups are still valid. Over time, people change jobs, abandon old accounts, or mistype addresses. Sending to these outdated contacts can lead to:
- Bounce-back errors
- Missed communication
- Wasted time
Scenario
In my Microsoft Outlook, I have a Contact group for recruiters. The turnover in the recruiting agency is quite high. When I send an email to the entire group, I receive a lot of errors in return. This happens because, for example, an agent is no longer working for that particular company. Consequently, the email is deactivated. There is no automatic function to remove those emails from the contact group.
The VBA Macro That Does the Cleanup
This macro scans each member of a selected contact group and removes those whose email addresses can’t be resolved. It then creates a new, cleaned-up version of the group.
Sub CleanContactGroup()
Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olFolder As Outlook.Folder
Dim olItem As Object
Dim distList As Outlook.DistListItem
Dim i As Long
Dim tempList As Outlook.DistListItem
Dim validMembers As Collection
Dim member As Outlook.Recipient
Set olApp = Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olFolder = olNS.GetDefaultFolder(olFolderContacts)
' Prompt user to select a contact group
Set olItem = olApp.ActiveExplorer.Selection.Item(1)
If Not TypeOf olItem Is Outlook.DistListItem Then
MsgBox "Please select a contact group in your Contacts folder.", vbExclamation
Exit Sub
End If
Set distList = olItem
Set validMembers = New Collection
' Check each member
For i = 1 To distList.MemberCount
Set member = distList.GetMember(i)
If member.Resolve Then
validMembers.Add member
End If
Next i
' Create a new contact group with valid members
Set tempList = olFolder.Items.Add("IPM.DistList")
tempList.DLName = distList.DLName & " - Cleaned"
For Each member In validMembers
tempList.AddMember member
Next member
tempList.Save
MsgBox "Cleaned contact group created: " & tempList.DLName, vbInformation
End Sub
How to Use It
- Open Outlook and press Alt + F11 to launch the VBA editor.
- Insert a new module and paste the code above.
- Close the editor and return to Outlook.
- Select the contact group you want to clean.
- Run the macro from the Developer tab or assign it to a custom button.
What This Macro Does (and Doesn’t Do)
- ✅ Resolves each contact to check if it’s valid
- ✅ Creates a new contact group with only valid members
- ❌ Doesn’t verify if the email is deliverable (e.g., SMTP bounce detection)
- ❌ Doesn’t remove members from the original group—your original stays intact
If you need deeper validation, you’d need to integrate with your mail server. This might include checking if an email actually receives messages. Alternatively, you can use a third-party API.
Wrap up
This macro is a great way to keep your Outlook contact groups tidy and functional. It’s especially useful for teams, newsletters, or any recurring group communication. Clean lists mean fewer headaches—and fewer bounce-backs.
If you’d like help customising this macro or integrating deeper validation, please don’t hesitate to reach out.