Folks;
very very carefully making my way 'round dealing with UNO for the first
time (thanks to NetBeans 6.0 and the appropriate tooling, this is a
breeze...), I read a bunch of tutorials on the 'net and, obviously
having nothing better to do, did my first things in there trying to
dump writer documents to HTML. The code I found and pasted together
essentially looks more or less like this:
[...]
String sUrl="file:///path.to.whatever.file...";
XComponent xComp = xCompLoader.loadComponentFromURL(sUrl,
"_blank", 0, new PropertyValue[0]);
XTextDocument aTextDocument = (XTextDocument)
UnoRuntime.queryInterface(
com.sun.star.text.XTextDocument.class, xComp);
XStorable xStorable = (XStorable)
UnoRuntime.queryInterface(XStorable.class, aTextDocument);
PropertyValue[] storeProps = new PropertyValue[1];
storeProps[0] = new PropertyValue();
storeProps[0].Name = "FilterName";
storeProps[0].Value = "HTML";
xStorable.storeToURL("file:///tmp/foo.html", storeProps);
[...]
So far, so good: As long as the file reachable via sUrl is an
OpenOffice Writer document (.odt), things are fine. As soon as I choose
trying to open and store a .doc file, I end up with
[...]
com.sun.star.task.ErrorCodeIOException:
at
com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:187)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:153)
[...]
whereas at least I can see that my (local) openOffice has opened the
file so it's capable of reading it. Two questions, about that:
(a) Reading some sources on that, I found that "FilterName" depends on
the application component used to open the file (Impress, Calc,
Writer, ...). However aren't .doc and .odt both opened by Writer?
(b) Is there a complete list of values allowed for the "FilterName"
property available somewhere on the 'net?
Thanks in advance and best regards,
Kristian
--
Kristian Rink * http://zimmer428.net * http://flickr.com/photos/z428/
jab: [EMAIL PROTECTED] * icq: 48874445 * fon: ++49 176 2447 2771
"One dreaming alone, it will be only a dream; many dreaming together
is the beginning of a new reality." (Hundertwasser)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]