Convert OpenXML documents in Windows using command line - OpenOffice.org Ninja

Convert OpenXML documents in Windows using command line

Posted by Andrew Z at Sunday, January 13, 2008 | Permalink

Do you need to convert between Microsoft Office 2007 OpenXML formats (.docx, .xlsx, .pptx) and OpenDocument formats (.odt, .ods, and .odp) on Windows? I wrote about converting OpenXML documents in Linux using command line, and it's even easier on Windows.

Don't like the command line? odf-converter-integrator is easier.

How to get the software

Path

OdfConverter.exe must be in your current working directory or your path. To view your path:

  1. Click Start menu.
  2. Click Run.
  3. Type CMD.EXE.
  4. Type the ENTER key.

Your path probably includes C:\WINDOWS, so if you copy OdfConverter.exe there, then it will always be in your path.

Usage

Assuming your filename is example.docx, then run this command to get a .odt:

OdfConverter.exe /I example.docx

To do a batch conversion from every .docx file in c:\files, run this command

OdfConverter.exe /BATCH-DOCX /I c:\files

For more options, run:

OdfConverter.exe /?

You will notice that OdfConverter is bidirectional, so it can also convert ODF to OOXML.

Related articles

12 comments:

John C said...

This is perfect! Thanks for the tips!

Uwe said...

Mathematical equations are not
translated.


Hello, I wrote a ODT file, containing enumerated list, tables colors and mathematical formula. I converted it to docx format.

- I could not open that file with the Oygen Openoffice which contains a docx import filter, files corrupted.
- converted the docx file back to odt, but then the math formula were gone.

can anybody comment on this?

darmayasa said...

hehehhe.... why you convert odt to ms oxml, save as .doc file then you can open using mso 12 (2007)or newer or older mso. It's ok cannot (yet) convert odt to docx, but I believe many hackers still work to make it better. Thx to all of hackers who work for this !

Jeremy said...

Do you have to be in a certain directory to run this, or does the ODF Converter have to be extracted to a certain directory?

The command prompt is telling me that "ODFConverter" is not recognized as a command.

Andrew Z said...

Jeremy: You either have to be in the same directory as OdfConverter.exe or you have to put OdfConverter.exe in your PATH. If you are not familiar with the PATH, then search Google for [Windows PATH] or [Windows environment variable].

Jeremy said...

Great help! Thank you so much!

Prakash Gomathinayagam said...

Really wonderful. Thanks a lot.

Z said...

I am trying to invoke the converter from Java.

The process worked really fast from command prompt, but it just hangs when I call it from java.

Has anyone ever tried this?

Antonio said...

GREAT!

Anonymous said...

ODFCONVERTER works great under XP(pro).....of course, you do have to understand DOS command line >

Halts under WIN98SE due to "PSAP.dll linked to missing NTDLL.dll" (vmm allocator)...>
even though NTDLL.dll is there, as well as PSAPI.dll (under WIN.../SYSTEM) >
Both .dll's look like original WIN98 (5-29-98 date), but i vaguely recollect having to install them for some pgm....>
Researching around, it looks like a PSAPI.dll must be written program-specific, at least in 98SE (??)

Anyway, Thanks, > works great under XP

Lou

Anonymous said...

it should be noted...the file you are seeking to convert should be moved to the windows directory as well. what a great tool!

sdtacoma said...

I have having problems converting the ODP file to a PDF file programmatically. Is there a way to convert a PPTX to something other than an ODP file?