我正在尝试将Outlook 2010 vsto AddIn迁移到Outlook 2013中。除尝试添加上下文菜单的一个问题外,所有操作都很顺利。VSTO Outlook 2013 AddHandler Application.ItemContextMenuDisplay Not Firing
当我在Outlook 2010中运行以下代码时,它向菜单中添加了“与Gradwell联系”:Happy Days!
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
AddHandler Application.ItemContextMenuDisplay, AddressOf Application_ItemContextMenuDisplay
End Sub
Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Microsoft.Office.Core.CommandBar, ByVal Selection As Microsoft.Office.Interop.Outlook.Selection)
If Selection.Count = 1 Then
If Selection.Item(1).class = olContactclass Then
CallContactButton = CommandBar.Controls.Add(Office.MsoControlType.msoControlButton)
With CallContactButton
.BeginGroup = True
.Caption = "Call contact with Gradwell"
.Parameter = Selection.Item(1).EntryID
.FaceId = 17
End With
End If
End If
End Sub
但是,当我在Outlook 2013中运行代码时,菜单不出现。
当我通过代码进行调试时,Sub Application_ItemContextMenuDisplay甚至不会触发。
任何人都可以提出为什么这不工作请吗?
谢谢
同意。我认为这就是答案所在。当项目死亡时不必跟随它。但我得出了同样的结论。旧的丝带设计师被开除了。 –