[Solved] Running a User Defined JAVA macro from BASIC macro

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
ganesh17
Posts: 2
Joined: Sat Sep 28, 2013 5:17 am

[Solved] Running a User Defined JAVA macro from BASIC macro

Post by ganesh17 »

I am new to writing macro for openoffice.

I had written a java macro. I have tested it seperately and it works correctly.
The JAVA macro is placed in C:\Program Files (x86)\OpenOffice 4\share\Scripts\java\CalledFromBasic folder and with the jar as CalledFromBasic.jar.

I am trying to call this from openoffice BASIC macro, for which the code is as follows.

Code: Select all

Sub Main

	MSPF = createUnoService("com.sun.star.script.provider.MasterScriptProviderFactory")
	scriptPro = MSPF.createScriptProvider("")
	xScript = scriptPro.getScript("vnd.sun.star.script:TestCallFromBasic.test?language=java&location=share\Scripts\java\CalledFromBasic")
	Thing = xScript.Invoke()

End Sub
I am getting unsatisfied query for interface of type com.sun.star.provider.XScriptProvider.
From http://www.openoffice.org/api/docs/comm ... #getScript I know that I need to give 2 parameters.
I'm not able to figure out how to call using getScript.
Can anyone help ?
Last edited by Hagar Delest on Wed Oct 09, 2013 11:14 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice Ver 4.0, Windows 7
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Running a User Defined JAVA macro from a BASIC macro

Post by hanya »

Hi, welcome to the forum.

You are using wrong URI to your Java macro. It should be something like:

Code: Select all

vnd.sun.star.script:CalledFromBasic.TestCallFromBasic.test?language=Java&location=share
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
ganesh17
Posts: 2
Joined: Sat Sep 28, 2013 5:17 am

Re: Running a User Defined JAVA macro from a BASIC macro

Post by ganesh17 »

I am testing that .
Thank you
OpenOffice Ver 4.0, Windows 7
Post Reply