Hey, how else were we going to do it?

Deleting duplicate contacts is a tricky business. How do you decide when a pair of contacts are the same?
Are they duplicates when they have the same name and phone number?
What if one has the home address and the other doesn't?
And what about the endless variations on a contact's name?
Here's one way. The following code loops through the default Contacts folder and checks for another contact with the same full name. If it finds one, you're prompted to delete it.
To look for duplicates, we use the Restrict method, instead of comparing each contact to all the others (which would be very wasteful).
We create a new Items collection consisting of all the contacts with a given full name. If there are more than one, there's a duplicate (according to our criteria). The ancillary functions are used to return a reference to the Contacts folder Items collection.
Sub DeleteDuplicateContacts()
Dim contactItems As Outlook.Items
Dim contact As Outlook.ContactItem
Dim contactFullName As String
Dim filteredContacts As Outlook.Items
Dim numberOfContacts As Long
Dim i As Long
Set contactItems = GetItems(GetNS(GetOutlookApp), olFolderContacts)
numberOfContacts = contactItems.Count
' loop through contact items folder
For i = numberOfContacts To 1 Step -1
If IsContact(contactItems.Item(i)) Then
Set contact = contactItems.Item(i)
contactFullName = contact.FullName
' check if any other contacts have the same full name
Set filteredContacts = _
contactItems.Restrict("[FullName] = '" & contactFullName & "'")
If Not filteredContacts.Count = 1 Then ' possible dupe
If MsgBox("Duplicate contact found, delete?" & _
vbCrLf & contactFullName, vbYesNo) = vbYes Then
contact.Delete
End If
End If
End If
Next i
End Sub
IsContact, GetItems, GetNS and GetOutlookApp may be found on the Utility Functions page.
This code is meant to be used in Outlook and should be placed in a standard module in the Outlook VB IDE. Where do I put my Outlook code?
Will try this out, I recently used http://www.scrubly.com to remove my duplicates