Andreas Schlüns schrieb:
news.gmane.org schrieb:
Hello,
I'm using the OfficeBean in a java project in windows, and I'd like
to disable document recovery after a crash for some documents.
I've tried to use the NoRestore Property, with no success.
If I close the application after loading the document, and then I
terminate soffice.bin, on the next start of openoffice I get the
Recovery window.
Any ideas?
Here's an extract from my code, look down for the complete working
code if you want to test:
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "NoRestore";
loadProps[0].Value = new Boolean(Boolean.TRUE);
System.out.println(System.currentTimeMillis() + " - Loading blank
document");
oBean.loadFromURL("private:factory/swriter",loadProps);
String docUrl =
createUNOFileURL("\\\\mobyv01\\test\\HP_DX2200_uT_P4_524.doc", oBean);
System.out.println(System.currentTimeMillis() + " - Loading document:
" + docUrl);
oBean.loadFromURL(docUrl, loadProps);
The property "NoRestore" is unknwon and so not supported by
loadComponentFromURL(). The only way to disable recovery is using
of the command line parameter "-norestore" on starting the office.
But that can be a problem for you. I do not know if the bean provide
a way to influence the start process of an used office instance ...
I use the following property:
System.setProperty("com.sun.star.officebean.Options", "-norestore");
Cheers
Harald
Regards
Andreas
---------------------------------------------------------------------
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]