Can Java Scripts no longer been called from basic macro ?

SOS sos at pmg.be
Thu Apr 14 07:43:03 UTC 2016


Hallo,

I need confirmation if a java script or macro can no longer (sinds (LO 
4) been called from a basic macro who was running fine on LO 3
using 4.4 I get a error calling the script:
oScript = 
oSP.getScript("vnd.sun.star.script:Library1\Macro1.js?language=JavaScript&location=user") 


the script is located under windows:

I made manually the directorys under 
Users\[UserName]\AppData\Roaming\LibreOffice\3\user\

"Scripts" directory
"JavaScript" directory
"Library1" directory with the Macro1.js file inside

C:\Users\[UserName]\AppData\Roaming\LibreOffice\3\user\Scripts\JavaScript\Library1\Macro1.js

the compleet examle from the "openoffice3.web.fc2.com" website:

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:Library1\Macro1.js?language=JavaScript&location=user") 

' Macro実行
oScript.invoke( array(),array(),array())
End Sub

Thanks for any help

Fernand



More information about the LibreOffice mailing list