Thursday, February 14, 2008

Microsoft docx files on Ubuntu (Gusty)

Two Types of Installation

Here are two related ways to view *.docx files in ubuntu.

Troubleshooting Note:

If, after following the instructions below you get one of the following two errors, then the following should help you out (at least they did for me).

(This error occurs when installing the command line version:)

OdfConverter: error while loading shared libraries: cannot open shared object file: No such file or directory

(This error occurs when installing it directly into openoffice:)

Read-Error. Data could not be read from the file.

Then the following should help you out (at least they did it for me). Type the command:
  • locate
I had, but I need Make the following symbolic link:
  • sudo ln -s /usr/lib/ /usr/lib/
Then use the command
  • sudo ldconfig
to update the library cache. Thanks to the poster at for this helpful instructions!

Command Line Converter Installation:

Install alien using Synaptic. Then download OpenOffice.OpenXML Translator 1.1.0 from here (unfortunately the download seems to require registration):

Open a terminal window and run:
  • alien -ct odf-converter-1.0.0-5.i586.rpm
This will convert the rpm to a tgz file. Now you'll want to unpack the newly generated *.tgz. Then copy over the binary file to a directory in your path:
  • sudo cp usr/lib/ooo-2.0/program/OdfConverter /usr/bin
  • OdfConvert /i example.docx

Want OpenOffice to open .docx directly. Here is how:

Follow the above directions up through the point of unpacking the newly generated *.tgz file. Now copy the following three files into your directories (note that the usr that you’re copying from is a directory that was inside the tgz file):
  • sudo cp usr/lib/ooo-2.0/program/OdfConverter /usr/lib/openoffice/program/
  • sudo cp usr/lib/ooo-2.0/share/registry/modules/org/openoffice/TypeDetection/Filter/MOOXFilter_cpp.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Filter/
  • sudo cp usr/lib/ooo-2.0/share/registry/modules/org/openoffice/TypeDetection/Types/MOOXTypeDetection.xcu /usr/lib/openoffice/share/registry/modules/org/openoffice/TypeDetection/Types/
Now you can open docx file using OOo! [If you get an error, look above at the troubleshooting notes.]


Andrew Z said...

odf-converter-integrator chocolate edition for Ubuntu does all this work for you.

josh said...

I'm not exactly sure why nobody else seems to have tried this, but if you download the odf-converter-x.x-x.oxt file from Novell's website, instead of the rpm, you can install it just as you would in Windows. AND, it will not only allow you to use .docx files it'll also do .xlsx and .pptx files as well. I'll outline the steps for you if you'd like:

Go to Applications > Office and open Word Processor
In Word Processor go to Tools > Extension Manager...
In Extension Manager click "Add..." and locate the .oxt file.

That's it!

Anonymous said...

The original error you listed references libgif, but the rest of your post references libtiff.

I got the libtiff error and fixed it the way you did, but then got the libgif error (and libgif, unlike libtiff, did not already exist on my system).

Anyway. Turns out you can just pull up your Synaptic Package Manager and have it grab libgif4

or if you're a cmd line guy:

sudo apt-get install libgif4

(why it's libgif4 and not libgif is beyond me!)