R
Richard
When I manually create a contact in Outlook XP, if the
contact already exists Outlook displays the 'Duplicate
Contact Deleted' dialog box. I can then choose the 'Update
new information from this contact to the existing one'
option, and Outlook takes care of the rest. When I create
new contacts via code, unfortunately this dialog box
doesn't appear and duplicate contacts are added.
Is there an object/method I'm not seeing that would force
this dialog box and/or functionality to work in code?
Here is some of the code (I'm using VB.Net, but you can
reply using VBA code if you need to).
Dim olAllENEWSContactItems As Outlook.Items =
olENEWSClientsFolder.Items
For Each objENewsContact In ENewsContacts 'This is an
array (structure) that has contacts to be added to
existing Contact folder.
olENewsContact = olENEWSClientsFolder.Items.Add
(Outlook.OlItemType.olContactItem)
With olENewsContact
.MessageClass = "IPM.Contact"
.LastName = objENewsContact.LastName
.FirstName = objENewsContact.FirstName
.Email1Address = objENewsContact.EmailAddress
.Save() 'This will create a duplicated contact.
End With
Next
contact already exists Outlook displays the 'Duplicate
Contact Deleted' dialog box. I can then choose the 'Update
new information from this contact to the existing one'
option, and Outlook takes care of the rest. When I create
new contacts via code, unfortunately this dialog box
doesn't appear and duplicate contacts are added.
Is there an object/method I'm not seeing that would force
this dialog box and/or functionality to work in code?
Here is some of the code (I'm using VB.Net, but you can
reply using VBA code if you need to).
Dim olAllENEWSContactItems As Outlook.Items =
olENEWSClientsFolder.Items
For Each objENewsContact In ENewsContacts 'This is an
array (structure) that has contacts to be added to
existing Contact folder.
olENewsContact = olENEWSClientsFolder.Items.Add
(Outlook.OlItemType.olContactItem)
With olENewsContact
.MessageClass = "IPM.Contact"
.LastName = objENewsContact.LastName
.FirstName = objENewsContact.FirstName
.Email1Address = objENewsContact.EmailAddress
.Save() 'This will create a duplicated contact.
End With
Next