It happens — duplicates on Outlook. Mostly when you tried to backup and restore your Outlook files, or simply have switched servers, or whatsoever.
Outlook maybe the worst and outdated email client in the worlds, as it has no duplicate filter. That’s why you have take things into your own hands.
If you are already tried or read about other solutions, let me spare your time. These methods below don’t work:
- Doesn’t work: Remove Duplicates by Export/Import PST Files
You may have realized that when you export outlook data as PST, there is a feature asking you that you don’t export/import duplicates. Well, guess what. Outlook does it anyway. Didn’t help at all. I have exported without duplicates. Then imported without duplicates. And what I got in the end? Duplicates! Thanks, Microsoft for wasting my time!
- Doesn’t work for me: Buy a tool that does it for you?
Sure, why not spent $40 or more to remove duplicates — a standard feature on almost every decent mailer has. Thanks, but no thanks.
This does work — in 5 minutes!
Below is the solution. With only one simple action, you can make duplicates disappear — it’s like a magic trick!
Step 1: Preparations
Go to File at the menu and click at “Options”, then go to “Trust Center”, click “Trust Center Settings”, in there click “Macro Settings” and select “Notification for all macros” like this:
Step 2: Copy & Paste A Script
Now you are going to write a script — or better: You will copy & paste the script I’m providing below. Don’t be scared — it’s dead easy! I’ll tell you exactly how.
If a security warning pops up called “Microsoft Outlook Security Notice”, just press “Enable Macros” to continue.
A new windows should open up called “Microsoft Visual Basic for Applications” that should look like this — don’t be scared. This is a lifesaver!
All you have to do now is to go to “Microsoft Outlook Objects”, press right mouse button, then go to “Insert” and then “Module”. Look below, it’s super easy:
A new window should appear on the left side. Now put this code in there:
Sub RemoveDuplicateItems() Dim objFolder As Folder Dim objDictionary As Object Dim i As Long Dim objItem As Object Dim strKey As String Set objDictionary = CreateObject("scripting.dictionary") 'Select a source folder Set objFolder = Outlook.Application.Session.PickFolder If Not (objFolder Is Nothing) Then For i = objFolder.Items.Count To 1 Step -1 Set objItem = objFolder.Items.Item(i) Select Case objFolder.DefaultItemType 'Check email subject, body and sent time Case olMailItem strKey = objItem.Subject & "," & objItem.Body & "," & objItem.SentOn 'Check appointment subject, start time, duration, location and body Case olAppointmentItem strKey = objItem.Subject & "," & objItem.Start & "," & objItem.Duration & "," & objItem.Location & "," & objItem.Body 'Check contact full name and email address Case olContactItem strKey = objItem.FullName & "," & objItem.Email1Address & "," & objItem.Email2Address & "," & objItem.Email3Address 'Check task subject, start date, due date and body Case olTaskItem strKey = objItem.Subject & "," & objItem.StartDate & "," & objItem.DueDate & "," & objItem.Body End Select strKey = Replace(strKey, ", ", Chr(32)) 'Remove the duplicate items If objDictionary.Exists(strKey) = True Then objItem.Delete Else objDictionary.Add strKey, True End If Next i End If End Sub
This is how it should look like on your end:
Step 3: Run that script!
That’s it! Run the script and duplicates inside this folder will disappear. How to run the script? Easy — see that “Run” feature on the menu… it’s this one here:
Now it will ask which folder. Select the folder you want the duplicates to be removed from.
If you liked this, please give me a nice comment, below. Thank you!