I'm writing an Application-Level Add-In for MS Outlook and now I need to determine what message is currently selected in Inbox folder (I mean the letter user is currently looking to). Can anyone help me?
A:
Ok, eventually I've found an answer, hope it will help somebody. Here it is:
var explorer = _appOutlook.ActiveExplorer();
if (explorer.Selection.Count > 0)
{
var sel = explorer.Selection[1];
if (sel is Microsoft.Office.Interop.Outlook.MailItem)
{
var item = sel as MSOutlook.MailItem;
MessageBox.Show("Selected letter: "+item.Body);
}
}
Mike Shilov
2010-10-14 06:40:51