Seeking to add custom items to context menu
I am using VS2015 and trying to create an outlook addin to add custom context menu items (when a user right-clicks on a mail item for instance). I have read this article:
https://msdn.microsoft.com/en-us/lib...or=-2147217396
However, I cannot get the GetCustomUI method to fire. Here is my code:
Code:
Public Class ThisAddIn
Implements Microsoft.Office.Core.IRibbonExtensibility
Private WithEvents myApp As Outlook.Application
Private Sub ThisAddIn_Startup()
Try
myApp = Me.Application
Catch ex As System.Exception
Diagnostics.Debug.Print(ex.Message)
End Try
End Sub
Private Sub ThisAddIn_Shutdown()
End Sub
Public Function GetCustomUI(RibbonID As String) As String Implements IRibbonExtensibility.GetCustomUI
Diagnostics.Debug.Print(RibbonID)
Return ""
End Function
End Class
Can anyone help me find what I might be missing?
Re: Seeking to add custom items to context menu
Quote:
what I might be missing?
Quote:
Public Function GetCustomUI(RibbonID As String) As String Implements IRibbonExtensibility.GetCustomUI
as far as i can see, this function is not being called, ribbonid has no value, there is no code to actually add items to the ribbon
follow the links on link you posted for some examples
Re: Seeking to add custom items to context menu
Quote:
Originally Posted by
westconn1
as far as i can see, this function is not being called, ribbonid has no value, there is no code to actually add items to the ribbon
follow the links on link you posted for some examples
Yes, I realise there is no code to add ribbon items but I need the routine to actually be invoked before I add them and it currently isn't. The article suggests that merely by implementing the IRobbonExtensibility interface it will be invoked.
Re: Seeking to add custom items to context menu
normally such a function is called in the appropriate workbook open event and the additional controls removed from the ribbon on workbook beforeclose event