On 11.03.2005, at 11:10, Tom Schindl wrote:

It would be great if you would summerize this small thread which showed us not to use the MediaDescriptor.html#URL to retrieve the URL form a document but instead the XModel in a small and tiny codesnippet.

It's worth the time you saved by people helping to your solve problem ;-)

OK. That is no problem. And thanks again for the help! :)
Here is the codesnippet for getting the url of a current opened document:


<-- snip -->
// XMultiComponentFactory xmcf = ...
// XComponentContext ctx = ...
Object desktop = xmcf.createInstanceWithContext("com.sun.star.frame.Desktop", ctx);
XDesktop xDesktop = (XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
XModel xmodel = (XModel)UnoRuntime.queryInterface(XModel.class,document);
if (xmodel != null) String url = xmodel.getURL();
<-- snap -->






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



Reply via email to