Hi,
Is there a way to load Writer supported documents only, and dismiss
(fail) on others? For example, I connect to an office server like so
local = uno.getComponentContext()
resolver = local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",
local)
context = resolver.resolve("uno:pipe,name=foopipe;urp;StarOffice.ComponentContext")
desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
Now I'd like to
desktop.loadComponentFromURL()
and if that file is e.g. and image that Writer can not open, then fail.
Same for any other file which is not a Writer supported file. I've
looked at this call
http://www.openoffice.org/api/docs/common/ref/com/sun/star/lang/XMultiComponentFactory.html#createInstanceWithArgumentsAndContext
but can't figure out if that's the right way to go. Or should I check
if the file is of a certain type before I pass it on to office? In that
case though, I might reject some funky format which Writer supports,
just because I didn't know about it.
Thanks!
Jens
--
Jens Tröger
http://savage.light-speed.de/
Context
- Load files into Writer only? · Jens Tröger
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.