2014-02-18 69 views
1

我有適用於Outlook 2007的VSTO。這也適用於Outlook 2010。現在我已將我的辦公室2010升級到2013年。我的VSTO也在此工作。但問題是我已經編寫代碼在右鍵菜單中添加一個ContextMenuItem。爲了實現這個,我實施了Application.AttachmentContextMenuDisplay方法。這裏是我的代碼片段:VSTO不適用於Outlook 2013

Private Sub Application_AttachmentContextMenuDisplay(ByVal CommandBar As Microsoft.Office.Core.CommandBar, ByVal Attachments As Microsoft.Office.Interop.Outlook.AttachmentSelection) Handles Application.AttachmentContextMenuDisplay 

    Dim DVCmdBarPopup As Office.CommandBarPopup 
     DVCmdBarPopup = CommandBar.Controls.Add _ 
      (Office.MsoControlType.msoControlPopup, , , 3, True) 

     With DVCmdBarPopup 
      .Caption ="Menu" 
      .BeginGroup = True 
      .Visible = True 
      .Tag = "Hello World." 
      .TooltipText = "Hello World." 
     End With 

End Sub 

此代碼工作正常,爲Outlook 2007在2010年可是當我安裝Office 2013,我試圖建立我的VSTO話,就說明我的錯誤是這樣的。

該項目目前包含對多個版本Office的引用,對14.0.0.0版的直接引用和對版本15.0的間接引用(通過'Microsoft.Office.Interop.Outlook._Explorer.CommandBars') .0.0。「 我不知道會發生什麼。請回復,如果你有任何想法或早點遇到這個問題。 謝謝。

回答

相關問題