P
Paul George via OfficeKB.com
Hello,
Can someone help me with sample code to synchronize contact items in two folders?
If the contact already exists in the second folder, I want to just update all the fields. I can do this by assigning each field. But is there an easier way to do this? Here is what I have:
' thisItem is from the source contact folder.
' is there a better way to check if the item already exists in the target folder?
Set oldItem = targetFolder.Items.Find("[FullName] = '" + thisItem.FullName + "'")
If TypeName(oldItem) = "Nothing" Then
Set copyItem = thisItem.Copy
copyItem.Move targetFolder
Else
' is there a better way to synchronize the two items?
oldItem.MobileTelephoneNumber = thisItem.MobileTelephoneNumber
oldItem.HomeTelephoneNumber = thisItem.HomeTelephoneNumber
' ... Rest of the fields
oldItem.Save
End If
Thanks much,
Paul
Can someone help me with sample code to synchronize contact items in two folders?
If the contact already exists in the second folder, I want to just update all the fields. I can do this by assigning each field. But is there an easier way to do this? Here is what I have:
' thisItem is from the source contact folder.
' is there a better way to check if the item already exists in the target folder?
Set oldItem = targetFolder.Items.Find("[FullName] = '" + thisItem.FullName + "'")
If TypeName(oldItem) = "Nothing" Then
Set copyItem = thisItem.Copy
copyItem.Move targetFolder
Else
' is there a better way to synchronize the two items?
oldItem.MobileTelephoneNumber = thisItem.MobileTelephoneNumber
oldItem.HomeTelephoneNumber = thisItem.HomeTelephoneNumber
' ... Rest of the fields
oldItem.Save
End If
Thanks much,
Paul