public static void ClearCrmId(this Outlook.ContactItem olItem) { var state = SyncStateManager.Instance.GetExistingSyncState(olItem); olItem.ClearUserProperty(SyncStateManager.CrmIdPropertyName); if (state != null) { state.CrmEntryId = null; } olItem.Save(); }
/// <summary> /// Remove all the synchronisation properties from this item. /// </summary> /// <param name="olItem">The item from which the property should be removed.</param> public static void ClearSynchronisationProperties(this Outlook.ContactItem olItem) { olItem.ClearUserProperty(Synchroniser <Outlook.ContactItem> .CrmIdPropertyName); olItem.ClearUserProperty(Synchroniser <Outlook.ContactItem> .ModifiedDatePropertyName); olItem.ClearUserProperty(Synchroniser <Outlook.ContactItem> .TypePropertyName); }