我正在嘗試將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甚至不會觸發。
任何人都可以提出爲什麼這不工作請嗎?
謝謝
同意。我認爲這就是答案所在。當項目死亡時不必跟隨它。但我得出了同樣的結論。舊的絲帶設計師被開除了。 –