views:

10

answers:

1

I've got a great MS Outlook 2003 addin going that adds some features to the context menu. What I am lacking is the ability to get the item I've right-clicked on.

So, in .NET (I'm writing in VB.NET but I know C# as well), how would I grab the item I've right-clicked on? I only want to show this particular context menu addition when I'm right-clicking on an email item, and then do something with that item.

I've already got the menu added and the event firing when I click on my custom buttons, I just need to know how to get the object that is under the cursor in addition to the work I do when clicked.

Thanks for your help.

+1  A: 

Try this (using C#):

foreach (MailItem mail in Application.ActiveExplorer().Selection)
{
    // ...
}
Jakob Christensen
Flawless. Thanks!
Honus Wagner