How to retrieve information from mail in Outlook addin?

ultimecia

New member
I could only manage to access the bottom 1 email from mail folder as there is a specific index number given here 'Item[1]'.
So my question is how to get the mail index when click on a mail.
Here is what i have done:
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);

textBox1.Text = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[1]).Body;
 
Back
Top