How to set Outlook contact “Notes” Property from .NET
-
21-09-2019 - |
Question
I need to programatically Insert a contact to outlook Contact using C# application. I am using the Microsoft.Office.Interop.Outlook.ContactItem Object.
I am able to set name, email, phone, etc. However, it does not seem to have a property for "NOTES"
How can I set the notes for the outlook contact?
Here is the code I am using:
Microsoft.Office.Interop.Outlook._Application outlookObj = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.MAPIFolder fldContacts = (Microsoft.Office.Interop.Outlook.MAPIFolder)outlookObj.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderContacts);
Microsoft.Office.Interop.Outlook.ContactItem newContact = (Microsoft.Office.Interop.Outlook.ContactItem)fldContacts.Items.Add(Microsoft.Office.Interop.Outlook.OlItemType.olContactItem);
newContact.FullName ="Whatever Name";
newContact.Email1Address = "Email@domain.com";
//no property for newContact.Notes :(
newContact.Save();
Solution
As far as I recall, you want newContact.Body
OTHER TIPS
Outlook saves Notes as Body while saving contact
string Notes = newContact.Body;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow