Can Java Scripts no longer been called from basic macro ?

Oliver Brinzing Oliver.Brinzing at gmx.de
Thu Apr 14 17:03:09 UTC 2016


Hi,

this will work in LO 4 and LO 5:

OPTION EXPLICIT

Sub oJavaScriptMacro
	Dim oMSPF as Object
	Dim oSP as Object
	Dim oScript as Object
	oMSPF = 
GetDefaultContext.getValueByName("/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory")
	oSP = oMSPF.createScriptProvider("")
	' JavaScript Macro
	oScript = 
oSP.getScript("vnd.sun.star.script:HelloWorld.helloworld.js?language=JavaScript&location=share")
	oScript.invoke(Array(), Array(), Array())
End Sub

Regards
Oliver



More information about the LibreOffice mailing list