Wednesday, January 30, 2008

Converting .docx files to OpenOffice format

Hello. Thanks for checking out my first blog. My hope is to share some of the basic tutorials, ideas and solutions I've run across in trying to solve some of my more obscure and perplexing computer-related tasks. The idea for this blog occurred to me as I was scratching my head trying to figure out how to open a .docx file I received.

Instead of shelling out the bucks for Microsoft Office when I bought the new home computer, I was adamant that OpenOffice would work just fine in our household, thank you very much.

And, at first, it was just fine. OO did meet our (at least, my) word processing and spreadsheet needs. I was able to open and read/write to Word and Excel files with no problem; even able to run Excel files with complex macros. Not a problem.

Then, I'm working at home and get the .docx file via email. If I was at work, everything would be fine. Even though I've got Office 2003, I've loaded the necessary MS compatibility packs to allow me to open .docx files.

But at home? Noooooooo. I gotta save money. And, its late and I want to call it a night. But, I really, really, need to look at this file before I go into work the next morning.

After some digging on the Internet, I finally came up with a solution for a computer that was sans Microsoft Office and didn't require an upload to the Internet (I was determined to find something that ran on my local machine.) I first tried the converter and reader that is available from the MS site, thinking that even if I could only read it, perhaps I could do a cut-and-paste.

No dice. No MS Office of any flavor on my machine, no conversion. I couldn't even get the reader to work.

Back to digging on the search engines.

I finally ran across OpenOfficeNinja which provided info on 'odf-converter'. It runs at the Windows command line and will convert .docx files to .odt format. Once in .odt, the file will be read directly by OpenOffice.

I went to this link on the OpenOfficeNinja site and followed Andrew Z's instructions on how to download and install the file. Note that he mentions the need to change the extension of the converter from 'odt' to 'zip'. When I downloaded the file to my Windows XP machine, it actually had an extension of 'oxt'. Regardless, when I changed the extension to 'zip' it worked as advertised.

I was lazy (and sleepy) and didn't want to bother dealing with typing pathnames and directories. So, I just unzipped the file to my root directory with a simple folder name like 'C:\docxconvert'. I then copied the file I wanted to convert to that folder, dropped into a Command Prompt (found on my WinXP machine under Start | Accessories) and at the 'c:>' prompt navigated to the directory by typing:

cd: c:\docxconvert

Then, I followed Andrew Z's instructions and ran:

odfconverter /I filename.docx

I did discover that odfconverter does not like long filenames or spaces within the filename. So, instead of trying to fool around with something like:

'3rd draft report.docx'

I changed it to simply:

'report.docx'

...ran odfconverter again, and, presto: I had 'report.odt' in the same directory.

The file fired right up in OpenOffice and I went to bed...after discovering yes, it could have waited until tomorrow.

ah well.

I learned something new.

2 comments:

Andrew Z said...

Steve,

Thanks for catching that typo!


Andrew

Steve's Tutorials said...

My pleasure. And thank you for the providing odfconverter. I REALLY did not want to shell out the bucks for M$ Office on my home machine just to be able to read .docx files!