2015-12-24 49 views
1

使用Visual Studio 2015爲Outlook 2013構建外掛程序。我已經爲Excel 2013構建了此外掛程序。外掛程序要從上下文菜單中訪問電子郵件的正文。從電子郵件正文上下文菜單訪問加載項

下面的片段通常是我如何添加按鈕,Excel的快捷菜單,但似乎無法找到如何爲Outlook電子郵件做到這一點:

Dim contextmenu As Office.CommandBar 
    Dim DDHButton As Office.CommandBarButton 
    contextmenu = Application.CommandBars("cell") 

    DDHButton = contextmenu.Controls.Add(Type:=Office.MsoControlType.msoControlButton, Before:=20) 

    With DDHButton 
     .FaceId = 2308 
     .Caption = "Button Name" 
     .Tag = "New Button" 
     .TooltipText = "etc. etc." 
    End With 

我試圖改變這到以下內容:

contextmenu = Application.ActiveExplorer.CommandBars("ContextMenuMailItem") 

而這條線的許多其他變化無濟於事。

我也遇到過創建一個功能區和編輯xml文件的建議,但也有這絕對沒有運氣!

有什麼建議嗎?

回答

相關問題