[email protected] wrote: > Quoting Mathias Bauer <[email protected]>: > >> 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". > > Unfortunately the solution with ".uno:Reload" does not work anymore > since OO.org 3.1 was released. Under Windows I cannot update the > opened document externally because it is locked. I need a workaround > with close and then reopen the document. Is there also a Dispatch API > command for close? I found ".uno:CloseDoc", but it doesn't work as > aspected. Nothing happens when I use ".uno:CloseDoc" instead of > ".uno:Reload".
As dispatching this command does the same as choosing "Reload" from the file menu this would mean that reloading does not work at all?! I couldn't reproduce that on Windows. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[email protected]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
