Jarrod566966

I am developing a VSTO add-in that will synchronize Outlook contacts with my company's CRM. There are a few instances where I need to iterate through an entire folder of contacts and modify them. For instance, when the user first syncs, I want to store an ID in one of the User fields.

Code Snippet

folder = Outlook.MAPIFolder folder folder = _application.GetNamespace("MAPI").Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderContacts);


for (int i = 1; i < folder.Items.Count; i++)
{
Outlook.ContactItem ci = folder.Items[i] as Outlook.ContactItem;
ci.User3 = "Some Id";
ci.Save();
ci = null;
}


When I run a loop like this (as a test), it will run in less than a second on Outlook 2003 with about 50 contacts. The same add-in on Outlook 2007 takes about a two minutes and uses a tremendous amount of memory during that time (30 or more meg increase). What in the world is going on here Any help would be appreciated.

Jarrod