B
BrassicaNigra
I have created a ribbon add-in for Outlook 2007. It is programmed to show
up when an email is in the read frame (ribbonID ==
"Microsoft.Outlook.Mail.Read"). It shows up and the OnClick event handler
works just fine.
When this button is clicked the add-in will pass an email address to another
application.
My problem is I don't know how to reference the item that is currently being
read in the Read pane. I followed the instructions at the following link to
get started.
http://msdn.microsoft.com/en-us/library/bb756875.aspx
Following is my OnClick handler function.
public void OnClick(Office.IRibbonControl control)
{
Application = Globals.ThisAddIn.Application;
Outlook.Folder inBox =
(Outlook.Folder)Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.MailItem miCurrent = (Outlook.MailItem)inBox.Items[5];
String strTo = miCurrent.To.ToString();
}
As you can see where I initialize miCurrent that I can get what I need when
the array index is hardwired (inBox.Items[5]), I just want to know what the
index value is for the item being displayed in the window in which the ribbon
appears.
Thank you for your help.
up when an email is in the read frame (ribbonID ==
"Microsoft.Outlook.Mail.Read"). It shows up and the OnClick event handler
works just fine.
When this button is clicked the add-in will pass an email address to another
application.
My problem is I don't know how to reference the item that is currently being
read in the Read pane. I followed the instructions at the following link to
get started.
http://msdn.microsoft.com/en-us/library/bb756875.aspx
Following is my OnClick handler function.
public void OnClick(Office.IRibbonControl control)
{
Application = Globals.ThisAddIn.Application;
Outlook.Folder inBox =
(Outlook.Folder)Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.MailItem miCurrent = (Outlook.MailItem)inBox.Items[5];
String strTo = miCurrent.To.ToString();
}
As you can see where I initialize miCurrent that I can get what I need when
the array index is hardwired (inBox.Items[5]), I just want to know what the
index value is for the item being displayed in the window in which the ribbon
appears.
Thank you for your help.