Duplicate emails in outlook

Talha 216 Reputation points
2021-08-11T16:27:08.89+00:00

Hi

we have office 365 tenant, who got a user having duplicate emails in one of his inbox folder. We tried using builtin cleanup tools in outlook but seems like the tool is not reading emails as duplicated. is there any other way or script we can use to clean a folder in inbox?

thanks,

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,072 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Vasil Michev 100.2K Reputation points MVP
    2021-08-11T17:27:17.817+00:00

    First of all, open the mailbox in OWA, just to make sure that you're not seeing some local Outlook issue. As for automated solution to this, try this script: https://eightwone.com/2013/06/21/removing-duplicate-items-from-a-mailbox/

    2 people found this answer helpful.

  2. Jade Liang-MSFT 9,976 Reputation points Microsoft Employee
    2021-08-12T02:38:33.207+00:00

    Hi @Talha ,

    Did the user import any .pst file to your mailbox before? As I know, it may cause some duplicate emails if we import a file and forget to choose "don't import duplicate". And agree with michev, we could first try to log into your web mail to check if there are any duplicate items there.

    Also, for your requirement of removing duplicate in Outlook, I found a relevant VBA script below. Accoridng to my tests, it could remove the duplicate items that I copy and paste manually in a specific folder, so please try to press "Alt + F11" to paste the script and run it in the user's Outlook to check if it could also work for you (Notice: we may need to Enable all macro in Outlook to run the script--File>Option>Trust center>Trust center settings>Macro settings>Enable all macro) :

    Sub DeleteDuplicateEmailsInSelectedFolder()  
      
    Dim i As Long  
    Dim n As Long  
    Dim Message As String  
    Dim Items As Object  
    Dim AppOL As Object  
    Dim NS As Object  
    Dim Folder As Object  
      
    Set Items = CreateObject("Scripting.Dictionary")  
      
    'Initialize and instance of Outlook  
    Set AppOL = CreateObject("Outlook.Application")  
      
    'Get the MAPI Name Space  
    Set NS = AppOL.GetNamespace("MAPI")  
      
    'Allow the user to select a folder in Outlook  
    Set Folder = NS.PickFolder  
      
    'Get the count of the number of emails in the folder  
    n = Folder.Items.Count  
      
    'Check each email starting from the last and working backwards to 1  
    'Loop backwards to ensure that the deleting of the emails does not interfere with subsequent items in the loop  
    For i = n To 1 Step -1  
      
        On Error Resume Next  
        'Load the matching criteria to a variable  
        'This is setup to use the Sunject and Body, additional criteria could be added if desired  
        Message = Folder.Items(i).Subject & "|" & Folder.Items(i).Body  
      
            'Check a dictionary variable for a match  
            If Items.Exists(Message) = True Then  
            'If the item has previously been added then delete this duplicate  
            Folder.Items(i).Delete  
        Else  
            'In the item has not been added then add it now so subsequent matches will be deleted  
            Items.Add Message, True  
    End If  
      
    Next i  
      
    ExitSub:  
      
    'Release the object variables from memory  
    Set Folder = Nothing  
    Set NS = Nothing  
    Set AppOL = Nothing  
      
    End Sub  
    

    Hope that would be helpful to you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

  3. Zenifer Smith 10 Reputation points
    2023-07-11T15:59:52.82+00:00

    If you're frustrated with duplicate emails cluttering your inbox, here's what you can do:

    1. Take a look at your folder view settings to ensure all emails are being displayed. Sometimes, certain settings can hide duplicates.
    2. Personally go through the folder and delete any duplicate emails you come across. Sorting the emails by subject, sender, or date can make it easier to spot duplicates.
    3. If the built-in cleanup tools in Outlook aren't doing the trick, consider using reliable third-party tools specifically designed to remove duplicate emails. They can save you time and effort.
    4. For tech-savvy folks, exploring PowerShell scripting is an option. You can find scripts online that help identify and remove duplicate emails. Just be sure to test them thoroughly before running them.

    Remember, it's always a good idea to back up your folder before making any changes. If you're unsure about any steps, reach out to your IT department or email administrator for guidance. They'll be happy to assist you!

    2 people found this answer helpful.
    0 comments No comments