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

  • Thread starter Thread starter Kevin
  • Start date Start date
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
 
Back
Top