2014-02-18 73 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。“ 我不知道会发生什么。请回复,如果你有任何想法或早点遇到这个问题。 谢谢。

回答

相关问题