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
?
(如果可以做到這一點的另一種方式,我很開放的建議太)