6
在我的VSTO outlook插件中,我试图将一个按钮显示出来,当我右键单击文件夹。在我启动功能,我有这样的:文件夹中的C#(outlook加载项)上下文菜单
Outlook.Application myApp = new Outlook.ApplicationClass();
myApp.FolderContextMenuDisplay += new ApplicationEvents_11_FolderContextMenuDisplayEventHandler(myApp_FolderContextMenuDisplay);
然后我有,处理程序...
void myApp_FolderContextMenuDisplay(CommandBar commandBar, MAPIFolder Folder)
{
var contextButton = commandBar.Controls.Add(MsoControlType.msoControlButton, missing, missing, missing, true) as CommandBarButton;
contextButton.Visible = true;
contextButton.Caption = "some caption...";
contextButton.Click += new _CommandBarButtonEvents_ClickEventHandler(contextButton_Click);
}
最后的处理程序点击....
void contextButton_Click(CommandBarButton Ctrl, ref bool CancelDefault)
{
//stuff here
}
我问题是如何将MAPIFolder Folder
从myApp_FolderContextMenuDisplay
发送到contextButton_Click
?
(如果可以做到这一点的另一种方式,我很开放的建议太)