Re: Looking for code on resolving duplicates



Thanks, Sue, the Restrict method is what I was looking for.

Gotta get your book...

Regards,
Chris

--
||||| www.kinata.net web design and hosting

"Sue Mosher [MVP-Outlook]" <suemvp@xxxxxxxxxxxxxxx> wrote in message
news:%23pMnWpDlFHA.572@xxxxxxxxxxxxxxxxxxxxxxx
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.

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




.



Relevant Pages