Extension can find macro in application but not in document
Posted: Thu May 13, 2021 1:08 pm
I have made an extension in java which calls a macro "vnd.sun.star.script:Standard.GraphAlgorithm.eval?language=Basic&location=document"
But it cannot find the macro it throws an exception. However, if I move my macro and module to "My macros and dialogs" and change the string to
"vnd.sun.star.script:Standard.GraphAlgorithm.eval?language=Basic&location=application"
it works. My document is a drawing.
The extension is written in java and gets the script by this code:
Has anybody ever tried to execute a document macro from an extension or somewhere else where the string "vnd.sun.star.script:.." is needed?
But it cannot find the macro it throws an exception. However, if I move my macro and module to "My macros and dialogs" and change the string to
"vnd.sun.star.script:Standard.GraphAlgorithm.eval?language=Basic&location=application"
it works. My document is a drawing.
The extension is written in java and gets the script by this code:
Code: Select all
XScriptProviderFactory spFactory= (XScriptProviderFactory) UnoRuntime.queryInterface(XScriptProviderFactory.class,
x.getValueByName("/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory"));
XScriptProvider sp = spFactory.createScriptProvider("");
XScript xScript = sp.getScript("vnd.sun.star.script:" + macroName);