开发者

How do I get the item I right-clicked on in an addin for Outlook 2003?

I've got a great MS Outlook 2003 addin going that adds some features to the context menu. Wha开发者_如何学Ct 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.


Try this (using C#):

foreach (MailItem mail in Application.ActiveExplorer().Selection)
{
    // ...
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜