How do I access Outlook 2003 Contacts and pull data through a Windows form C#
I am working on creating a simple email form within the application, but instead of having a new list of contact email address is it possible to connect directly to the Outlook users contact list or on the Exchange server?
-Rich
Loading
Hirendra SisodiyaPosted Apr 28, 2010, 1:20 AM
you can also save new contacts and update existing contact from .net side......
thanks
Please mark as answer if it helps
richPosted Apr 27, 2010, 7:09 PM
Hirendra SisodiyaPosted Apr 27, 2010, 1:10 AM
Check my Article, this article have an example also- i think it can be helpful for you :
http://www.c-sharpcorner.com/UploadFile/hirendra_singh/963/?ArticleID=7bebcd81-7b30-4aca-bdb7-ae721171749e
ifyou have any problem let me know
thanks
Please mark as answere if it helps
richPosted Apr 26, 2010, 10:39 AM
Thanks for the post, where would I put that? as Using? or within the button or field?
I ma trying to build a dropdown list that connects to the Outlook Contacts.
Can you show an example of where the code would be, I am very new at this.
Thanks.
Hirendra SisodiyaPosted Apr 26, 2010, 3:02 AM
Try this code:
Microsoft.Office.Interop.Outlook.Application outlookObj = new Microsoft.Office.Interop.Outlook.Application();
MAPIFolder Folder_Contacts = (MAPIFolder)outlookObj.Session.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
Microsoft.Office.Interop.Outlook.Items oItems = Folder_Contacts.Items;
for (int i = 0; i < oItems.Count; i++)
{
Microsoft.Office.Interop.Outlook.ContactItem contact = (Microsoft.Office.Interop.Outlook.ContactItem)oItems[i+1];
String Fname = contact.FirstName;
String LName = contact.LastName;
String Email = contact.Email1Address;
}
thanks
Please mark as answere if it helps