Here are some line in C#
// Add commandbar for this Visio session
applicationCommandBars =
(CommandBars)visioApplication.CommandBars;
// Get active menubar
menuBar = applicationCommandBars.ActiveMenuBar;
// add a menu to the end
menuPopup =
(CommandBarPopup)menuBar.Controls.Add(MsoControlType.msoControlPopup,
System.Type.Missing,
System.Type.Missing,
System.Type.Missing,
true);
// Set the menu properties.
setMenuProperties(menuPopup, strMenuTitle,
strMenuToolTip, strMenuTag);
// Add the item
menuItem =
(CommandBarButton)menuPopup.Controls.Add(MsoControlType.msoControlButton,
System.Type.Missing,
System.Type.Missing,
System.Type.Missing,
false);
// Set the item properties.
setItemProperties(menuItem, strTitle, strTooltip, strTag, bIsGroup);
// Add a Click event handler.
menuItem.Click += new
_CommandBarButtonEvents_ClickEventHandler(menu_Click);
Enjoy with C#