_CommandBarButtonEvents_ClickEventHandler eventHandler;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
try
{
eventHandler = new _CommandBarButtonEvents_ClickEventHandler
(MyButton_Click);
Word.Application applicationObject =
Globals.ThisAddIn.Application as Word.Application;
applicationObject.WindowBeforeRightClick +=
new Microsoft.Office.Interop.Word.ApplicationEvents4_
WindowBeforeRightClickEventHandler(App_WindowBeforeRightClick);
}
catch (Exception exception)
{
MessageBox.Show("Error: " + exception.Message);
}
}
convert it in vb.