F
Ferro Francesco
Hello,
I have created a menu for Visio (inspired by the visio saple code)
applicationCommandBars = (Microsoft.Office.Core.CommandBars)
theApplication.CommandBars;
menuBar = applicationCommandBars.ActiveMenuBar;
menuPopup = (Microsoft.Office.Core.CommandBarPopup)
menuBar.Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlPopup,
1, "", 10, true);
menuPopup.Caption = "Title menu";
menuItemStop = (Microsoft.Office.Core.CommandBarButton)
menuPopup.Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
1, "", 1, true);
menuItemStop.Caption = "Stop menu";
menuItemStop.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption;
menuItemStop.Visible = true;
In the visio sample exemple there just the Menu creation but not the
click event.. So i have added this
menuItemStop.Click += new
Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler
(eventHandler.CommandBarButtonClickStop);
Where eventHandler is my menuEventHandler...
So this code Work When i open Visio, and i click on my Menu Title Menu-
But if I open Visio, and then i open a new document.. the Menu doesn't
work anymore !? I have no event when i click on my Menu.
Where is the problem?
Thank's
I have created a menu for Visio (inspired by the visio saple code)
applicationCommandBars = (Microsoft.Office.Core.CommandBars)
theApplication.CommandBars;
menuBar = applicationCommandBars.ActiveMenuBar;
menuPopup = (Microsoft.Office.Core.CommandBarPopup)
menuBar.Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlPopup,
1, "", 10, true);
menuPopup.Caption = "Title menu";
menuItemStop = (Microsoft.Office.Core.CommandBarButton)
menuPopup.Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
1, "", 1, true);
menuItemStop.Caption = "Stop menu";
menuItemStop.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption;
menuItemStop.Visible = true;
In the visio sample exemple there just the Menu creation but not the
click event.. So i have added this
menuItemStop.Click += new
Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler
(eventHandler.CommandBarButtonClickStop);
Where eventHandler is my menuEventHandler...
So this code Work When i open Visio, and i click on my Menu Title Menu-
StopMenu I can breakpoint on the methode CommandBarButtonClickStop..
But if I open Visio, and then i open a new document.. the Menu doesn't
work anymore !? I have no event when i click on my Menu.
Where is the problem?
Thank's