Okay. My Mistake. Its a Uno Component which provides add in for calc (I used the *M....oft* Word for this) So as it is java it seems that I don't have access to XScriptContext.
Kind regards, Martin -----Ursprüngliche Nachricht----- Von: Ariel Constenla-Haile [mailto:ariel.constenla.ha...@googlemail.com] Gesendet: Samstag, 22. Mai 2010 19:37 An: dev@api.openoffice.org Betreff: Re: AW: [api-dev] java-macro: Not able to access CurrentComponent? Hello Martin, On Saturday 22 May 2010, 14:03, Martin Dobiasch wrote: > Hello Ariel, > > Sorry. Attached there are some parts of my class. I removed a lot of > functions which have nothing to do with the problem. > The troublemaker is CSDRightFrom (at the bottom of the source code) > Hope the source-code is now easier to understand. > Thanks for your and any other help! A short answer (not sure it helps): a Java *macro* consist of a public static method, that takes as parameter a com.sun.star.script.provider.XScriptContext http://api.openoffice.org/docs/common/ref/com/sun/star/script/provider/XScri ptContext.html use its methods to access what you need (copy & paste from the API reference): * getDocument Obtain the document reference on which the script can operate * getInvocationContext provides access to the context where the script was invoked * getDesktop Obtain the desktop reference on which the script can operate * getComponentContext Obtain the component context which the script can use to create other uno components but your code is NO Java-macro; it is a UNO component. What are you developing? a Java macro or a UNO component? Regards -- Ariel Constenla-Haile La Plata, Argentina --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org