foreach (Contact contactValues in contactsFromDb) { Outlook.MAPIFolder contacts = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts); Outlook.Items colItems = contacts.Items; string contactId = contactValues.Id.ToString(); string FilterString = "[CustomerID] = '" + contactId + "'"; Outlook.ContactItem excistingContact = (Outlook.ContactItem)colItems.Find(FilterString); if (excistingContact == null) { Outlook.ContactItem oContact = (Outlook.ContactItem)contacts.Items.Add(Common.Helper.ContactClassForm); AssignvaluesToContact(contactValues, null, contacts); i++; } else { if (excistingContact.LastModificationTime < contactValues.LastModifiedDate) { Outlook.ContactItem oContact = (Outlook.ContactItem)contacts.Items.Add(Common.Helper.ContactClassForm); AssignvaluesToContact(contactValues, excistingContact, contacts); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)