Benjamin Vollmer wrote:

> Hello,
> 
> I work on an extension where in some cases the opened document is 
> updated externally. So I have to reload my document.
> 
> In a snippet I found this way:
> 
> PropertyValue[] aLoadProps = new PropertyValue[0];
> 
> // reload current document
> xComponentLoader.loadComponentFromURL(this.xFrame.getController().getModel().getURL(),
>  
> "_self", 0, aLoadProps);
> 
> But in my context this snippet doesn't work. Under Ubuntu nothing 
> happens when the code is executed, under Windows there occurs an UNO 
> Runtime Error. At the moment I reload the file manually over File -> 
> Reload. This works but it is not really a solution.
> 
> What is the right way to reload a document via API?

You can use the Dispatch API to achieve that. The command you have to
dispatch at the documents' frame is ".uno:Reload".

Regards,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "nospamfor...@gmx.de".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to