/Microsoft.Office.Interop.Outlook.Application outlookApp = new Microsoft.Office.Interop.Outlook.Application(); //Microsoft.Office.Interop.Outlook.MAPIFolder Folder_Contacts = (Microsoft.Office.Interop.Outlook.MAPIFolder) //outlookApp.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderContacts); //Outlook.ContactItem newContact = (Outlook.ContactItem)Folder_Contacts.Items.Add(Microsoft.Office.Interop.Outlook.OlItemType.olContactItem); try { newContact.CompanyName = CompanyName; newContact.FirstName = FirstName; newContact.LastName = LastName; newContact.MiddleName = MiddleName; newContact.BusinessAddressStreet = BusinessAddressStreet; newContact.BusinessAddressCity = BusinessAddressCity; newContact.BusinessAddressState = BusinessAddressState; newContact.BusinessAddressPostalCode = BusinessAddressPostalCode; newContact.Email1Address = Email2Address; newContact.Email2Address = Email1Address; newContact.Save(); newContact.Display(true); } catch { MessageBox.Show("The new contact was not saved."); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)