That's because you need to query for the correct interface first,
before you use such a method. In this case I would query the
com.sun.star.frame.XModel interface and call the method "getURL()" on
the returned object.
In order to code in Java for OOo, you need to know about such things
as queryInterface, and I suggest that you read the first chapters of
the Developer's Guide which should explain this.

-- 
Best Regards
Christian Junker

On Thu, 10 Mar 2005 13:46:47 +0100, Ines Pfauch <[EMAIL PROTECTED]> wrote:
> On 09.03.2005, at 13:20, Aidan Butler wrote:
> 
> > Hello,
> >  The URL of the document is stored as a property of the document
> > component. The following python code will print the URL
> >
> > #ctx is the current context
> >
> > desktop = ctx.ServiceManager.createInstanceWithContext( \
> >            "com.sun.star.frame.Desktop", ctx )
> > document = desktop.getCurrentComponent()
> > print document.URL
> > Alternatively a document.getPropertyValue("URL") should do the trick
> 
> Maybe I so something wrong but this does not work, when I try to
> convert it to java.
> 
> I can understand the whole thing unto here:
> 
> // XComponentContext ctx ...
> // XMultiComponentFactory f ...
> XDesktop desktop =
> (XDesktop)f.createInstanceWithContext("com.sun.star.frame.Desktop",
> ctx);
> XComponent document = (XComponent)desktop.getCurrentComponent();
> 
> But a document.getPropertyValue("URL") method does not exist.
> Please help me.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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

Reply via email to