Home Forums General XMetaL Discussion Disable "Insert" Menu Reply To: Disable "Insert" Menu

Derek Read

Reply to: Disable "Insert" Menu

A quick workaround that might get you what you need is the following:

Remove the entire Insert menu from the “Menu bar” (main menu):
[code]//XMetaL Script Language JSCRIPT:
var commandBars = Application.CommandBars;
var menuBar = commandBars.item(“Menu bar”);
var insertMenu = menuBar.Controls.item(4);
insertMenu.Delete();
[/code]

Restore the “Menu bar” (put the Insert menu back):
[code]//XMetaL Script Language JSCRIPT:
var commandBars = Application.CommandBars;
var menuBar = commandBars.item(“Menu bar”);
menuBar.Reset();[/code]

Depending on when the first portion of this script is run you may wish to add an if/then check after selecting menuBar.Controls.item(4) to make sure that item is in fact the Insert menu before removing it. You could do that with the DescriptionText property.

Note that these scripts will affect either the default menu (no documents are open) or the menu for the current document customization (a document is active).

Reply

Products
Downloads
Support