I'm using next code to invoke macro function in java class :
Code: Select all
XComponentContext mxRemoteContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
XMultiComponentFactory mxRemoteServiceManager = mxRemoteContext .getServiceManager();
Object oMSPFac = mxRemoteServiceManager.createInstanceWithContext("com.sun.star.script.provider.MasterScriptProviderFactory",mxRemoteContext);
XScriptProviderFactory xScriptProviderFactory = (XScriptProviderFactory) UnoRuntime.queryInterface(XScriptProviderFactory.class, oMSPFac);
Object oMSP = xScriptProviderFactory.createScriptProvider("");
XScriptProvider xScriptProvider = (XScriptProvider) UnoRuntime.queryInterface(XScriptProvider.class, oMSP);
XScript xScript = xScriptProvider.getScript("vnd.sun.star.script:Standard.Module1.fnTest?language=Basic&location=application");
short[][] aOutParamIndex = new short[1][1];
Object[][] aOutParam = new Object[1][1];
String[] test= {"1","2","3"};
xScript.invoke(test, aOutParamIndex, aOutParam);
how can I call the macro function of specify file? e.g. I want to call one macro function of E:\temp.ods.
Thanks in advance!