j'ai un programme qui créer un fichier Writer à partir d'un modèle, et j'aimerai l'enregistrer au format *.odt.
Je pensais qu'il suffisait de faire un export comme pour vers un PDF ou un fichier MS Word 97 avec :
Code : Tout sélectionner
XStorable DocSave = (XStorable)UnoRuntime.queryInterface(XStorable.class, Document);
PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "MS Word 97";J'ai écrit ceci:
Code : Tout sélectionner
XStorable DocSave = (XStorable)UnoRuntime.queryInterface(XStorable.class, Document);
PropertyValue[] storeProps = new PropertyValue[0];
try
{
DocSave.storeAsURL(StoreURL, storeProps);
}
catch (com.sun.star.io.IOException e)
{
e.printStackTrace();
} et je reçois l'erreur suivante:
Code : Tout sélectionner
com.sun.star.task.ErrorCodeIOException:
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:275)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:141)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:377)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:346)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:106)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:845)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:794)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:151)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:137)
at $Proxy14.storeAsURL(Unknown Source)Merci d'avance

