Home » Blog » Outlook » VBA to Remove Outlook Duplicate Recipients – A Free Solution

VBA to Remove Outlook Duplicate Recipients – A Free Solution

Priya | Modified: 2022-04-16T04:15:10+00:00|Outlook | 5 Minutes Reading

This whole article is based on the VBA to remove Outlook Duplicate recipients. So, stay with us till the last to know the best answer for the same.

However, lots of professionals using Outlook for their mailing needs. But, while composing an email they will encounter duplicate recipients. The problem is when they have to deal with the new unnecessary task. Most of the time it becomes very frustrating for them.

Therefore, to make the task easier for the professionals. Here, in this blog, we are going to discuss and free manual techniques to remove duplicate Outlook recipients using VBA codes.

But, before going further to the solutions, let’s have a look on brief of VBA codes.

What is VBA Codes?

As VBA code is a scripting language. So, with the help of Visual Basic for Applications language you can create macros. Also, by doing so, you can easily control Outlook. Likewise, with VBA macros, you can perform complex tasks which is not possible by default.

In addition, it allows taking all the advantages of the Outlook object model including with application level.

VBA to Remove Outlook Duplicate Recipients

Though, VBA scripting is a complex task. Hence, you need to be extra careful while performing it. Also, follow the steps mentioned below because any mistake can delete your important data from Outlook.

  • First, run the Outlook program
  • Now, click Alt+F11 to open Visual Basic editor or you can switch the Developer option. Then, click on the Visual Basic
  • Now, from the VBA window open a blank module
  • After this, copy and paste the following VBA codes into the module

Sub RemoveDuplicateRecipients()
Dim objCurrentMail As MailItem
Dim objRecipients As Recipients
Dim ContactGroupFound As Boolean
Dim i, n As Long

Set objCurrentMail = ActiveInspector.CurrentItem
ContactGroupFound = True

While ContactGroupFound = True
Set objRecipients = objCurrentMail.Recipients
ContactGroupFound = False

‘Expand the contact groups in “To” field
For i = objRecipients.Count To 1 Step -1
If objRecipients(i).AddressEntry.DisplayType <> olUser Then
For n = 1 To objRecipients(i).AddressEntry.Members.Count
If objRecipients(i).AddressEntry.Members.Item(n).DisplayType = olUser Then
objCurrentMail.Recipients.Add (objRecipients(i).AddressEntry.Members.Item(n).Address)
Else
objCurrentMail.Recipients.Add (objRecipients(i).AddressEntry.Members.Item(n).Name)
ContactGroupFound = True
End If
Next
objRecipients(i).Delete
End If
Next i
objRecipients.ResolveAll
Wend

‘Remove the duplicate recipients
For i = objRecipients.Count To 1 Step -1
For n = (i – 1) To 1 Step -1
If objRecipients(i).Address = objRecipients(n).Address Then
objRecipients(i).Delete
Exit For
End If
Next
Next
End Sub

  • Once pasting is done, add the VBA project in the Quick Access Toolbar
  • Now, set the Outlook macro security level to low
  • After all this now you can try this code
  • So, to try this code compose any email
  • Then, add contact group and contacts in To field
  • Select Marco button in Quick Access Toolbar
  • After that, Outlook automatically expand the contact group and then remove the duplicate recipients.

Secure Way to Remove Duplicate Recipients From Outlook

Is VBA to remove Outlook duplicate recipients is complex or complicated? Are you not a technical expert to understand it properly? Because the VBA codes are not for normal users. Only technique users can use this method.

Hence, here in this section, we are going to introduce you to the most secure way to delete duplicate recipients from Outlook.

SYSDaddy Outlook Duplicate Remover Software is one of the best and most searched toolkit. This tool is capable to delete all kinds of duplicate items from Outlook. Such as emails, contacts, calendars, and more.

Download the software from below to check its actions.

Download Now Purchase Now

Also, the tool has an amazing UI that is so straightforward. Therefore, anyone can easily understand it. Furthermore, this program is able to delete duplicate from Outlook PST, OST, and BAK files. Moreover, it also support all Outlook versions.

Steps To Delete Outlook Duplicate Recipients

Firstly, download and install the software on your computer. Then, launch the software and follow the steps given below-

  1. Secondly, select Add File(s) or Add Folder option
  2. VBA to Remove Outlook Duplicate Recipients

  3. Now, choose the Within Folder option from Duplicate Option
  4. within folder to delete duplicates

  5. Choose the property from Specific Duplicate Criteria
  6. Lastly, click on the Next button to start “Remove Outlook Duplicate Recipients” process.
  7. VBA to Remove Outlook Duplicate Recipients

Conclusion

However, many of you out there may be seeking a free solution to delete duplicate items from Outlook. Where, the VBA to remove Outlook duplicate recipients is one of them. Hence, in the above write-up, we have discussed the detailed VBA method for the same. In addition, we have also discussed an automated method if you find the VBA method is complicated.

So, you can use any method as per your needs. But, it is recommended to use the automated SYSDaddy Program to save your time. Though the final choice is yours. So, choose the appropriate method smartly.