Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete duplicate lines of email in Outlook 2003

Status
Not open for further replies.

jpkeller55

Technical User
Apr 11, 2003
131
US
I have a folder in Outlook (2003) that contains duplicate emails. Due to a sych process with our network server, somehow a bunch of emails got duplicated. I moved all the duplicate emails into a folder.

Does anybody know any code or macro that I can run to delete every other row of email in this folder?

Thanks for any help you may be able to lend.
 
Thanks WingedTek for your reply. Unfortunately, I cannot upload this add-in on my company laptop which has all the duplicate emails. I really don't need to identify the duplicates as I already have them in a folder. All I really need is some simple code to select every other record in the folder. The folder is a subfolder of my inbox named "Duplicates". I have been trying to tweak the attached code which empties all email from the junk folder but I can't figure out how to change it to the subfolder of "Duplicates" and how to select every other record. I am guessing some sort of loop statement that increments by 2 instead of 1 would work. Again, I am lost. I appreciate any help anyone can lend.
Code:
Dim oFld as Outlook.MapiFolder  
  
Set oFld=Application.Session.GetDefaultFolder(olFolderJunk)  
  
With oFld  
  
While .Items.Count  
  
.Items(1).Delete  
  
Wend  
  
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top