Hi,

First of all, thanks for this answer.

Thanks to that, I can call a method from a macro, but the code creates a
new component each time I execute the macro.

What I would is to be able to work on the component that has been
already created before.

When calc starts, a new component is created, I can work with it by a
graphic interface that I can open using a button on the officeToolBar.

I think it should be great to be able to call a method in a macro that
can do the same things that can be done by using the graphic interface.
But this should be on the same objects, so : without recreating a new
component but by accessing the one in use.

That could be done if I find a way to get a link with the component in
use inside a macro.

Like something like that :

myService = getUNOServiceInUse("org.openoffice.csp.solver.Solver")

msgbox myService.execute()


Is there a way to do that ?

Thanks in advance,

Mikael

On Wed, 2007-01-31 at 15:44 +0100, Steffen Grund wrote:
> This should work in the right context:
> 
> document   = ThisComponent.CurrentController.Frame
> dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
> 
> rem
----------------------------------------------------------------------
> dispatcher.executeDispatch(
>      document, "cspsolver.SolverImpl:execute", "", 0, Array())
> 
> HTH, Steffen
> 
> 
> Mikael De Bie wrote:
> > Hi everybody,
> > 
> > I created a uno component. It contains an "execute" function. I can
call
> > this function by using an button on the officeToolBar. What I want
to do
> > is be able to call this function from a macro too.
> > 
> > This is the code that permit the call from the button on the
toolbar :
> > -----------------------------------
> >     <node oor:name="OfficeToolBar">
> >             <node oor:name="cspsolver.SolverImpl" oor:op="replace">
> >             <node oor:name="m1" oor:op="replace">
> >                <prop oor:name="URL" oor:type="xs:string">
> >                    <value>cspsolver.SolverImpl:execute</value>
> >                </prop>
> >                 <prop oor:name="ImageIdentifier"
oor:type="xs:string">
> >                     <value/>
> >                </prop>
> >                 <prop oor:name="Title" oor:type="xs:string">
> >                    <value xml:lang="en-US">CSP</value>
> >                </prop>
> >                <prop oor:name="Target" oor:type="xs:string">
> >                    <value>_self</value>
> >                </prop>
> >                <prop oor:name="Context" oor:type="xs:string">
> >
<value>com.sun.star.sheet.SpreadsheetDocument</value>
> >                </prop>
> >             </node>
> >             </node>
> >         </node>
> > ----------------------------------
> > 
> > Is there a way to call cspsolver.SolverImpl:execute from a macro ?
if
> > yes, can somebody tell me how ?
> > 
> > Thanks in advance, 
> > 
> > Mikael
> > 

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

Reply via email to