Hi Community,
I am having a problem with updating the commands for specific menu. When I remove menu and recreate another one with same name all commands are staying the same.
I tried 2 options of deleteing menu:
// option 1
RemoveMenu("!StructuredTextContextMenu", "Menu1");
UpdateMenus();
// option 2
var oMenu = app.GetNamedMenu("!StructuredTextContextMenu");
var oAltMenu = app.GetNamedMenu("Menu1");
if (oAltMenu.ObjectValid()) {
oMenu.Delete(oAltMenu);
UpdateMenus();
}
I tried to remove commands as well, but this brings to problems:
oCommand = app.GetNamedCommand('cmd');
// option 1, does not delete command
oCommand.Delete();
// option 2, FrameMaker crashes , though no errors in ESTK
RemoveMenu("Menu1", oCommand.Name)
UpdateMenus();
Does anyone know how to update the list of commands in menu?
Thanks.