Exemplo n.º 1
0
        private object AddContextMenu(string caption, string tag)
        {
            //application.CustomizationContext = application.ActiveDocument;

            Office.CommandBar commandBar = application.CommandBars["Text"];

            // Remove if there is a duplicate already.
            Office.CommandBarButton control =
                (Office.CommandBarButton)commandBar.FindControl
                    (Office.MsoControlType.msoControlButton, missing,
                    tag, true, true);

            if ((control != null))
            {
                contextButtons.Remove(tag);
                control.Delete(true);
            }

            //Create the new menu buttion and add it.
            Office.CommandBarButton button = (Office.CommandBarButton)commandBar.Controls.Add(
                Office.MsoControlType.msoControlButton);
            button.accName = caption;
            button.Caption = caption;
            button.Tag     = tag;
            button.Click  += ConextMenu_Click;
            contextButtons.Add(tag, button);

            return(button);
        }
Exemplo n.º 2
0
 private void ThisAddIn_Shutdown(object sender, EventArgs e)
 {
     _drawGraphButton.Delete();
     _drawAllGraphsButton1.Delete();
     _drawAllGraphsButton2.Delete();
 }
Exemplo n.º 3
0
 private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
 {
     addBtn.Delete(true);
     //RemoveRightBtns();
 }