0
votes

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

1

1 Answers

1
votes

I have the same problem. It seems that those events are removed (check: http://msdn.microsoft.com/en-us/library/office/ee836188.aspx#OL14DevRef_ChangesSince2007)

Also, in the documentation of 2013 the events don't show up (check here: http://msdn.microsoft.com/en-us/library/jj236930%28v=office.15%29.aspx)

I'm looking into the Ribbon XML currently, which seems to be the solution. But it also means you need two plugins. One RibbonXML to change the Context menu and one to actually do something.