开发者

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

开发者 https://www.devze.com 2022-12-22 09:38 出处:网络
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.

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

精彩评论

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

关注公众号