c# - How to access the MS Outlook mail using the EntryIDCollection? -
i reading outlook mail using code:
microsoft.office.interop.outlook.application myapp = new microsoft.office.interop.outlook.application(); microsoft.office.interop.outlook.namespace mapinamespace = myapp.getnamespace("mapi"); microsoft.office.interop.outlook.mapifolder myinbox = mapinamespace.getdefaultfolder(microsoft.office.interop.outlook.oldefaultfolders.olfolderinbox); int = myinbox.items.count; string strsubject = ((microsoft.office.interop.outlook.mailitem)myinbox.items[i]).subject; string senderemailid = ((microsoft.office.interop.outlook.mailitem)myinbox.items[i]).senderemailaddress; string toemailid = ((microsoft.office.interop.outlook.mailitem)myinbox.items[i]).to; string ccemailid = ((microsoft.office.interop.outlook.mailitem)myinbox.items[i]).cc; string bccemailid = ((microsoft.office.interop.outlook.mailitem)myinbox.items[i]).bcc; string creationtime = ((microsoft.office.interop.outlook.mailitem)myinbox.items[i]).creationtime.tostring();
i getting entryidcollection
well. how can read mail using entryidcollection
instead of mail count i.e. i
in code?
i using ms outlook 2010.
you can use namespace.getitemfromid
Comments
Post a Comment