Duplicate Contacts in Outlook (2003)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

ibm37

Thread Starter
Joined
Feb 28, 2003
Messages
604
Does anyone know of a quick way to get rid of duplicate contacts in Outlook?
(i.e 3 of each) I know I could use View | Phone list and manually delete, but wondering of there is a quick way? Sort/filter??

Thanks
 
Joined
Jul 25, 2004
Messages
5,458
Hi there,

You should be able to use some code like this ...

Code:
Sub DeleteDups_Contacts()
    
    Dim MyColl As Object
    Dim ct As MAPIFolder, ci As ContactItem
    Dim ns As NameSpace
    Dim strFirst As String
    Dim strTmp As String
    
    Set MyColl = CreateObject("Scripting.Dictionary")
    Set ns = ThisOutlookSession.Session
    Set ct = ns.GetDefaultFolder(olFolderContacts)
    
    On Error Resume Next
    For Each ci In ct.Items
        If Not (MyColl.Exists(ci.FullName)) Then
            MyColl.Add ci.FullName, "1"
        Else
            strTmp = strTmp & ci.FullName & vbNewLine
'            ci.Delete
        End If
    Next
    
    MsgBox "Deleted:" & vbNewLine & Trim(strTmp)
    Set MyColl = Nothing
    
End Sub
To install, hit Alt + F11 | Insert | Module, paste on right. Put cursor in routine, press F5. Note I commented out the delete line, I'd run it once with it, then if you're sure the message is correct, uncomment the line (take out the ' sign) and run it.

HTH
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top