So, I want to disable a single menu option from Office when I launch a new document. Most of what I've read redirect me to this, which is a monstruous Java example I'm not sure I understand fully (I'm new with the API). I tried to convert most of the code there, but I don't know how to convert this line

for (int i = 0; i < aCommandURLTestSet.Length; i++) { // Create the nodes with the XSingleServiceFactory of the configuration Object xNewElement = xSetElementFactory.createInstanceWithArguments(new uno.Any(aArgs)); //can't use aArgs as an argument for uno.Any() if (xNewElement != null) { // We have a new node. To set the properties of the node we need // the XPropertySet interface. XPropertySet xPropertySet1 = (XPropertySet)xNewElement;

// Insert the node into the Disabled set xPropertySet.setPropertyValue("Command", new uno.Any(aCommandURLTestSet[i])); xNameContainer.insertByName(aCmdNodeName, new uno.Any(xNewElement)); //can't use aArgs as an argument for uno.Any() } } }

I want to disable a single menu option from Office when I launch a new document.

Do you want to hide it only from the menu an from the toolbar and from the hotkeys, or do you want really disable it?

My first tip:Just create a template file (manually), with unvisible "Save as..." menu item, and without "Save as..." toolbar icon by usage the Customize feature. Then use that template in your program (load it instead of a new, empty document).

And some questions:Why you want to do it? What about the normal Save function and the simple "copy + rename" feature of the operating system? Everybody can achieve a virtual "Save as..." by these functions... And everybody can switch ON the invisible functions...

Tibor Kovacs, Hungary; LO4.4.7, LO6.1.5 on Win7-10 x64Prof.PortableApps, winPenPack: LO3.3.0-6.2.0 and AOO4.1.5 Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.