public void LoadButtons() { try { //add a menu item to the Tools Menu Item CommandBar commandBarTools = applicationObject.ActiveExplorer().CommandBars["Tools"]; CommandBarControl cmdBarControl = commandBarTools.Controls.Add(MsoControlType.msoControlButton, 1, "", 1, true); cmdBarControl.Visible = true; cmdBarControl.Caption = "Open My Application"; //add an event handler for the new button CommandBarButton Movebutton = (CommandBarButton)cmdBarControl; Movebutton.Click += new _CommandBarButtonEvents_ClickEventHandler(Movebutton_Click); Movebutton.Visible = true; Movebutton.PasteFace(); } catch (System.Exception ex) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)