I am attempting to migrate a Outlook 2010 vsto AddIn to Outlook 2013. All has gone well except for one problem trying to add a context menu.
When I run the following code in Outlook 2010 it adds a "Call contact with Gradwell" to the menu - 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
But, when I run the code in Outlook 2013 the menu doesn't appear.
When I debug through the code the Sub Application_ItemContextMenuDisplay doesn't even fire.
Can anyone suggest why this is not working please?
Thanks