Link to home
Start Free TrialLog in
Avatar of murphyws
murphyws

asked on

With Visual Basic, how do I find and remove duplicate messages from Outlook 2007 Folders that identical with the exception of the Received time?

My Outlook Folders and subfolders contain duplicate copies of many messages that are identical with the exception of the time Received field.  For some unknown reason the server sent duplicate copies and my Outlook client accepted them as new messages. I want to identify the duplicate messages and delete the duplicate copy. I want to ensure that the only difference between the deleted message and the retained message is the Received time. I do not want to delete two messages from the same sender with the same subject where the message contents are different. Sample header information from three messages is shown below. Two of the messages are duplicates with different received times.  The third message has the same subject and received times as one of the duplicate messages, but a different message body. Other messages in my Outlook Folders are identical and share the same Received time. I also want to delete the duplicate copy of the messages that share the same Received time. Will you please share your Visual Basic code with me that will automate this duplicate file identification and deletion process?

From: sender@sent.com
To: receiver@received.com
Subject: Message with two different received times
Received: Tuesday, October 28, 2008 11:33 PM
Size: 62K
Message: This is a test message that was received at two different times. I want to use a macro to identify the duplicate copy and delete it.

From: sender@sent.com
To: receiver@received.com
Subject: Message with two different received times
Received: Tuesday, October 28, 2008 11:34 PM
Size: 62K
Message: This is a test message that was received at two different times. I want to use a macro to identify a the duplicate copy and delete it.

From: sender@sent.com
To: receiver@received.com
Subject: Message with two different received times
Received: Tuesday, October 28, 2008 11:34 PM
Size: 62K
Message: This is not a duplicate message and should not be deleted by the macro.
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, murphyws.

I might be able to help with this.  Does the solution need to check for duplicates in every mail folder you have or only certain ones?
Avatar of murphyws
murphyws

ASKER

HI BlueDevilFan:

I appreciate your interest in helping. Yes the solution needs to check for duplicates in every mail folder.

The initial mental model I used to file Emails into pst files was flawed and I am trying to recover. Eventually I hope to get to the point where all Emails associated with a specific topic are in a single pst file, but I am not anywhere close to being there yet.

Regards,
Bill
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial