E
Evgchech
Hello!
I am trying to add customized entries to Shape and Page context menus.
I have downloaded example how to perform this task for application menu it
works just fine. I can not figure it out how to acquire handle to shape or
page context menu.
Here is an code example
Microsoft.Office.Core.CommandBars applicationCommandBars;
Microsoft.Office.Core.CommandBar menuBar;
Microsoft.Office.Core.CommandBarPopup menuPopup;
// Get the CommandBars object from Visio.
applicationCommandBars = (Microsoft.Office.Core.CommandBars)
visApplication.CommandBars;
// Get the active menu bar from the CommandBars object.
menuBar = applicationCommandBars.ActiveMenuBar;
//Add a pop-up menu to the end of the active menu bar.
menuPopup = (Microsoft.Office.Core.CommandBarPopup)
menuBar.Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlPopup,
1, "", 10, true);
menuPopup.Caption = "C&ustom";
The first and the second lines acquires handle to application menu bar
I need to replace those lines so i could address shape or page context menus
in the same way
Best Regards
I am trying to add customized entries to Shape and Page context menus.
I have downloaded example how to perform this task for application menu it
works just fine. I can not figure it out how to acquire handle to shape or
page context menu.
Here is an code example
Microsoft.Office.Core.CommandBars applicationCommandBars;
Microsoft.Office.Core.CommandBar menuBar;
Microsoft.Office.Core.CommandBarPopup menuPopup;
// Get the CommandBars object from Visio.
applicationCommandBars = (Microsoft.Office.Core.CommandBars)
visApplication.CommandBars;
// Get the active menu bar from the CommandBars object.
menuBar = applicationCommandBars.ActiveMenuBar;
//Add a pop-up menu to the end of the active menu bar.
menuPopup = (Microsoft.Office.Core.CommandBarPopup)
menuBar.Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlPopup,
1, "", 10, true);
menuPopup.Caption = "C&ustom";
The first and the second lines acquires handle to application menu bar
I need to replace those lines so i could address shape or page context menus
in the same way
Best Regards