Tuesday, September 25, 2007

 

Google Docs still doesn't support OOXML?

Dear Google,

It's hard to believe that with billions of dollars in your accounts you still can't pay someone to write a 10 line converter for your online docs to load the new MS docx file format.

Here's the simple Python code you need to convert a file from MS Word 2007 to the old doc format. You must run this on a server that has Word and can load the docx format. Please get someone to do this soon.

from win32com.client import Dispatch
infilename = "C:\\foobar.docx"
outfilename = "C:\\foobar.doc"
word = Dispatch("Word.Application")
file = word.Documents.Open(infilename)
file.SaveAs(FileName=outfilename,FileFormat=0)

#the output file can now be imported into Google docs
#FileFormat = 0 is from the 'wdFormatDocument' entry win32com.client.constants

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?