Sub Delete_Duplicate_Contacts()
Dim ns As Outlook.NameSpace
Dim contacts As Outlook.MAPIFolder
Dim i As Integer, j As Integer, same As Boolean
Dim full_name As String, business_phone As String, body As String
Dim curr_full_name As String, curr_business_phone As String, curr_body As String
Set ns = GetNamespace("MAPI")
Set contacts = ns.GetDefaultFolder(olFolderContacts)
On Error Resume Next
For i = contacts.Items.Count To 2 Step -1
full_name = contacts.Items(i)
business_phone = contacts.Items(i).BusinessTelephoneNumber
body = contacts.Items(i).body
same = False
For j = i - 1 To 1 Step -1
curr_full_name = contacts.Items(j)
curr_business_phone = contacts.Items(j).BusinessTelephoneNumber
curr_body = contacts.Items(j).body
If full_name = curr_full_name And _
business_phone = curr_business_phone And _
body = curr_body Then
Debug.Print "SAME: " & full_name & "," & business_phone & "," & body
same = True
Exit For
End If
Next j
If same Then
'Remove comment from next line to delete the contact
'contacts.Items(i).Delete
End If
Next i
Set contacts = Null
Set ns = Null
MsgBox "Done"
End Sub