abbreviation: OO = OpenOffice

I would appreciate advice and guidance on the following questions:

>From within a Calc spreadsheet cell,
1. Is it possible to directly call OO BeanShell routines,
   similar to OO Basic?
2. Is it possible to directly call OO BeanShell routines
   that take parameters?
3. Is it possible to directly call OO BeanShell routines
   that reside in *.ods script section, not in "My Macro" section?
3. Is it possible to directly call any of OO BeanShell routines
   in an OO BeanShell *.bsh script that contains multiple BeanShell routines,
   similar to OO Basic?

Thanks.

Ray

 -----

// reference: www.oooforum.org/forum/viewtopic.phtml?p=145732

// in OO BeanShell script section "My Macro.lib-01.func-01.bsh"

public String bsh_test_01( String mssg )  // how to directly call from 
spreadsheet?
{
 mssg = mssg + " in @My Macro@";
 mssg = mssg.replaceAll( "@","\"" );
 return mssg;
}

String mssg;
mssg = "OO BeanShell test routine";
mssg = mssg + " in @My Macro@";
mssg = mssg.replaceAll( "@","\"" );
return mssg;


// in OO Basic script section *.ods.Standard.lib-01

function test_01( ) as String
dim bsh_func_path as String
dim oMSPF as object
dim oScript as Object

bsh_func_path = 
"vnd.sun.star.script:lib-01.func-01.bsh?language=BeanShell&location=document"
bsh_func_path = 
"vnd.sun.star.script:lib-01.func-01.bsh?language=BeanShell&location=user"
oMSPF = 
createUnoService("com.sun.star.script.provider.MasterScriptProviderFactory") 
oScript = oMSPF.createScriptProvider("").getScript(bsh_func_path)
test_01 = oScript.invoke(Array(), Array(), Array())
end function


// in *.ods spreadsheet, any cell

= test_01()
should see text returned by the BeanShell script


________________________________________
PeoplePC Online
A better way to Internet
http://www.peoplepc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to