How to get CC email addresses in Microsoft.Office.Interop.Outlook.MailItem?

K

Kevin

Hello,

I am writing a simple application, which first gets all the emails in
my Outlook inbox, then for each email, gets all the names and email
addresses in the from, to and CC list.

My code is like:

Microsoft.Office.Interop.Outlook.Application myApp = new
Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace =
myApp.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.MAPIFolder myInbox =
mapiNameSpace.GetDefaultFolder
(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
Microsoft.Office.Interop.Outlook.MailItem oneMail =
(Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[6];

I can do that for the "from", but not the CC. When I print out the
"oneMail.CC", it is just a string of all the receipts names (divided
by ;). How can I get their email addresses? I am pretty sure their
email addresses are somewhere there, since I can click each one in
Outlook and see it.

Thanks a lot.

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top