I want to add my custom items to Connector(Document, Shape, etc) So I'm
using
//Get a UIObject object that represents Microsoft Office Visio built-in
menus.
Visio.UIObject obj = VisApp.BuiltInMenus;
//Get the MenuSet s collection.
Visio.MenuSets mss = obj.MenuSets;
//Get the drawing window menu set.
short itmid = (short)Visio.VisUIObjSets.visUIObjSetDrawing;
Visio.MenuSet ms = mss.get_ItemAtID(itmid);
//Get the Menus collection.
Visio.Menus menus = ms.Menus;
//Add a new menu before the Window menu.
Visio.Menu mnu = menus.AddAt(7);
mnu.Caption = "TEST";
//Get the MenuItems collection.
Visio.MenuItems mitems = mnu.MenuItems;
//Add a menu item to the new menu.
Visio.MenuItem item = mitems.Add();
//Set the Caption property for the new menu item.
item.Caption = "&TestCaption";
//VisDocument.CustomMenus mnus = obj;
//Tell Visio to use the new UI when the document is active.
VisDocument.SetCustomMenus(obj);
But nothing happens all menus are regular without any new items there. Where
is my problem?
--
Tamir Khason
You want dot.NET? Just ask:
"Please,
www.dotnet.us "