Is there a .NET API for OpenOffice?
EDIT: Is there a OpenOffice SDK for .NET?
In April 2011, Oracle stopped development of OpenOffice.org and fired the remaining Star Division development team.
Yes, OpenOffice uses the same standardized OpenDocument (ODF) file formats as StarOffice. The ODF files can be used with many other programs on many platforms. In general, Microsoft Office file formats can be read and saved by Apache OpenOffice.
Let's take a look: LibreOffice: LibreOffice is a free and open-source office suite, developed by The Document Foundation. OpenOffice: Apache OpenOffice (AOO) is an open-source office productivity software suite. It descends from OpenOffice.org and IBM Lotus Symphony, and it's a close cousin of LibreOffice.
LibreOffice emerges as a better option out of the two in the battle of LibreOffice vs. OpenOffice. The interface, templates, and Wizard make the former rank higher. You can import, save, and use modern file formats, making this productive office software an intuitive word processor.
If you have OpenOffice installed, then you can use the "OpenOffice SDK" (current version here) to control that instance from several programming environments, including .NET. You can use OpenOffice this way to accomplish a number of different things; one example is converting files from one file format to another. It's analogous to how you can control Microsoft Office via COM.
A set of CLI/.NET bindings come with the SDK, and are by default installed in (example for SDK v3.0):
C:\Program Files\OpenOffice.org_3.0_SDK\sdk\cli
I've found Mark Alexander Bain's Creating an OpenOffice Calc Document with C# to be the most straightforward, hands-on, introductory article to controlling OpenOffice that way.
The CLI bindings are mostly a port/mapping of the non-.NET object model, so you'll want to get into things like the non-.NET-specific OpenOffice API Developer's Guide.
So far the main difference I've found between the CLI bindings and the other documentation is that with the CLI bindings you cast an object to a new interface using normal .NET cast syntax rather than with the UnoRuntime.queryInterface() method. For example, instead of
XComponentLoader xComponentLoader =
(XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, desktop);
just use
XComponentLoader xComponentLoader = (XComponentLoader)desktop;
There are also some pretty technical docs of how the OpenOffice/UNO stuff gets mapped onto .NET concepts in the CLI binding here: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/CLI/CLI_Language_Binding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With