uno

Migrating Java UNO code from OpenOffice 2.4 to 3.0

I had a nifty small tool written to convert spreadsheets to plain text. Since it was my private hacker tool, it relied on OpenOffice 2.x to read the files. But when I installed OpenOffice 3 and tried to get it get it to run, I failed miserably, because I'm either missing some JAR files or half the classes have been replaced. I'm includ...

What is the (single) best online source for learning OpenOffice.org scripting API

I am using OpenOffice.org for most of my not so very frequent Office Suite needs and most of the time it is more than adequate replacement for it's commercial alternative. Where it falls short though is the scripting API. I am yet to find the documentation that would make sense of the API in a way that would let me concentrate on my tas...

How do you set the text direction for a TextTable Cell in OpenOffice?

I want to set the text direction for some cells in a TextTable so that they are vertical (i.e., the text is landscape instead of portrait). You can do this in Writer by selecting the cell(s), and going to: Table - Text Properties - Text Flow - Text Direction However, I cannot figure out how to do this through the API. I tried using Char...

OpenOffice.org development with pyUno for Windows—which Python?

At home, on Linux, I've experimented with pyUNO to control OpenOffice.org using Python. I've been using Python 2.6. It all seems to work nicely. Now I thought I would try one of my scripts (run a graphical diff for ODF doc) on Windows. But when I tried to run it, I got: ImportError: No module named uno According to udk: Python UNO Br...

Using PyUNO on Windows and CentOS

Is there any way to use OpenOffice's PyUNO without using the version of Python that comes with OpenOffice? I mean, can I install a package (on Windows and CentOS) that uses the version of Python that's already on the server? I'm trying to use OpenOffice in headless mode so that I can do document conversion with a script (ultimately...

How do I create an XTextTable in OpenOffice.org uno using C#?

Discussion on OOoForum.org In python, using pyuno, I can do it like this: table = self.model.createInstance("com.sun.star.text.TextTable") This doesn't seem to work in C#. Here is my test code (I realize I probably don't need all those using statements, but I am adapting someone else's code): using System; using unoidl.com.sun.star....

How do I set the properties for an XTextTable in OpenOffice.org uno using C#?

Discussion on OOoForum.org In python, I can do something like this: table.BreakType = PAGE_BEFORE table.HoriOrient = 0 table.RightMargin = 6.93 * 2540 - table_width In C#, I can't find a way to set properties. XTableTable only has a few methods available to it, and none of them seem to do anything like this. How do I set properties i...

Openoffice3.1 pyuno confusing errors

I'm trying to get the sample and other sample codes i find for pyuno running with openoffice 3.1.1 and python 2.5 with no luck. Unfortunately, pyuno does not give any clues about what goes wrong. In [1]: import uno In [2]: local = uno.getComponentContext() In [3]: resolver = local.ServiceManager.createInstanceWithContext("com.sun.st...

In OpenOffice, how do I check if my XComponentContext has been closed?

I have a small application that generates three different template documents in OOo Writer. When one of the three "generate" buttons is clicked, this is part of the code that is executed (in C#): // Connect to OOo if (componentContext == null) componentContext = uno.util.Bootstrap.bootstrap(); XMultiServiceFactory multiServiceFacto...

How do I reconnect to OpenOffice.org once it has been closed?

Here is a sample application that creates a Window with a single Button inside. When clicked, it connects to OOo (if not already connected) and creates a text document. This works fine unless all the documents created in OOo are closed. Then, I get a DisposedException when trying to create the next chart. This is understandable, but OO...

How do I programmatically save a document in OpenOffice.org?

I'd like to save a TextDocument created through OpenOffice.org UNO to a file on the disk. What is the best way to do this? Edit: This is the C# code that I ended up using. document is an XTextDocument. protected void Save (string path) { string url = "file://" + path; PropertyValue [] propertyValues = { new PropertyValu...

Embedding objects into Microsoft Word and OpenOffice Writer

I am looking for some references on how to implement the following feature: ability to embed objects (e.g. diagrams) into word processors and being able to edit them in their respective "mother" application For example, MS Word and Visio work like this together, allowing the user to easily edit/tweak the diagrams after adding them ...

Is .rdb file required each time I compile my open office UNO program

Hi, Just wondering, is my program specific 'xyz.rdb' file (generated using makefile) required each time I run my program (xyz.exe) ? Can I embed the .rdb file in the main .exe file generated using VC++ 2008. If the .rdb file is not in path, I usually get the 'Registry Error'. Thanks, Aiwee ...

OpenOffice with .NET: how to iterate throught all paragraphs and read text

How to iterate through all paragraphs in OpenOffice Writer document and output text. I have Java examples, but don't know how to convert code to C#. Java example could be found here: http://wiki.services.openoffice.org/wiki/API/Samples/Java/Writer/TextDocumentStructure My C# code: InitOpenOfficeEnvironment(); XMultiServiceFactory multi...

OpenOffice iterating through TextTable detect merged and split cells (calculate colspan and rowspan)

I am using OpenOffice uno api to iterate through all text in writer document. To iterate over text tables currently I am using XTextTable interface getCellNames() method. How I could detect merged and split cells. I want to export table to html, so I should calculate colspan and rowspan. I would appreciate any suggestions... I am out of...

OpenOffice, writing a document to a servlet response

Currently we use OpenOffice to grab bookmarks in a template file document and replace them with content from our DB via Java. The lines of code that actually save the file look like this... XStorable storable = UnoRuntime.queryInterface(XStorable.class, document); // Save as Word 97 Document PropertyValue[] properti...

unoconv --stdin option?

Is there some limitation that makes having a --stdin option especially difficult for unoconv (Convert between any document format supported by OpenOffice) to support? It looks likes the file type is used to determine the document type so if standard input is used instead of a file name then the --doctype option would be required. But asi...

Opening multiple documents in a same window with UNO

I have script in python using pyuno that extracts data from many excel files. My problem is that for every file I open and close a window with url = unohelper.systemPathToFileUrl(os.path.abspath(file_name)) file = desktop.loadComponentFromURL(url, "_blank", 0, () ) and file.close(True) Is there any way to extract data from the f...

OpenOffice.org: Using UNO to convert docx to html

Testing on both Debian and Mac OSX On Debian, openoffice.org-writer package is installed Using latest OpenOffice.org version: 3.2.1 Tried both unoconv and JODConverter I start by launching a headless OpenOffice instance: soffice -headless -nofirststartwizard -accept="socket,host=localhost,port=8100;urp;" I'm in the right directory ...

Copy a whole ODT (Openoffice Writer) document section to other document with Openoffice Java API (UNO API)

Dear all, I need to use the OpenOffice Java API to copy a document section and paste it over another document section. So far I have managed to copy the text of the section of the source document and paste it over the section at the target document (see the example below). However, the problem is that non-text elements (graphics, form...