That's definitely the hard way. Instead check to see if there are any matches at all using the MAPIFolder.Items.Find method, assuming objContacts is your Contacts folder and strAddress is a variable with the email address:
Set cItems = objContacts.Items
strFind = "[Email1Address] = " & _
Chr(34) & strAddress & Chr(34)
Set dupItem = cItems.Find(strFind)
If Not dupItem is Nothing Then
' do whatever you need to do to dupItem
End If
Repeat as needed. Or use Restrict instead of Find if you suspect there may be more than on duplicate.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> I've been looking for many hours for some simple open-source
> VBA code that doesn't delete duplicate contacts, but
[quoted text clipped - 22 lines]
> Regards,
> mvsmith
Chris Kinata - 29 Jul 2005 23:56 GMT
Thanks, Sue, the Restrict method is what I was looking for.
Gotta get your book...
Regards,
Chris
||||| www.kinata.net web design and hosting
That's definitely the hard way. Instead check to see if there are any matches at all using
the MAPIFolder.Items.Find method, assuming objContacts is your Contacts folder and
strAddress is a variable with the email address:
Set cItems = objContacts.Items
strFind = "[Email1Address] = " & _
Chr(34) & strAddress & Chr(34)
Set dupItem = cItems.Find(strFind)
If Not dupItem is Nothing Then
' do whatever you need to do to dupItem
End If
Repeat as needed. Or use Restrict instead of Find if you suspect there may be more than on
duplicate.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx