OpenOffice.org has become more and more suited for replacing Microsoft Office. Sadly, porting lots of Microsoft Office documents to OpenOffice format (aka OpenDocument Format) is not easy. If you have only one, five, or ten files you could just open them one by one and resave in OpenOffice.org, but how about hundreds or thousands of multi-megabyte documents in a corporate environment?
This little program batch / mass convert Microsoft Office documents (*.doc, *.xls, and .ppt) to their OpenOffice equivalent (.odt, *.ods, and *.odp (aka OpenDocument Format)). The nice thing about this script is that it converts all documents specified in the input, including subdirectories. The result can be put in another directory, and it retains its original directory structure (the script takes care of keeping the relative path). Use it at your own risk!
Requirements
- Windows or Linux (tested in Windows XP SP2 and Ubuntu Linux 6.10)
- OpenOffice.org (tested in OpenOffice.org 2.0)
- Python (I think version >= 2.4). If you are in Windows, you need to download it (any recent version will do). Most Linux distributions have Python already in it, if not, don’t ask me how to install it ;).
Download
Download mso2ooo (15.88 kB)
How to Use
I wanted it to be as easy as possible as my skill allows but oh well ;)
Configuration
Configuration was done by editing the file mso2ooo_config.txt. source_dir is the directory where mso2ooo will look for MS Office documents (including subdirectories). dest_dir is the directory where mso2ooo will put the converted documents in (retaining directory structure). The rest of the configuration is not very important (and I am a lazy documentor, yes). Talking about directories (or folders, in WIndows term) here would be too long if you don’t understand about it. (the default configuration starts looking for documents from where the script is located, btw)
Running mso2ooo
For the impatient:
- configure anything in
mso2ooo_config.txt
- run
mso2ooo.py
- run
mso2ooo.odt
Conversion is done in two steps: listing files that need to be converted and converting them (for real). The list generation is done by python (mso2ooo.py), while the rest of the work is done by OpenOffic.org Basic macros inside mso2ooo.odt.
Firstly, run mso2ooo.py. In Windows, you can run mso2ooo.py by opening / clicking / double-clicking it in Windows Explorer. In (my Ubuntu) Linux, you need to run python ./mso2ooo.py from the command line. I have created mso2ooo.sh that does this (so you only need to open / click / double-click it just like Windows’).
If you don’t mess up with your configuration and you have Python, a window will appear for a brief moment (depending on how long the scan takes place). After the windows disappear (or the script have finished its job) there will be a new file, _listoffice.txt. You don’t need to do anything with that file.
Then, open mso2ooo.odt. Be sure to enable macros! The conversion needs macros enabled. I do not install any malware in the macro (but third parties can, so use it at your own risk). You should be able to see some kind of progress (i.e. that a file is being converted). When it finishes (it could take a very long time, especially if your presentations are hundreds of Mb) it will say “xxx file(s) converted”, and a list of documents that failed to be converted (if any).
You may then close the document. You may save it but I don’t recommend you to do so (messages from the last conversion will be left behind if you do that).
Etc
The Python script (not the script in mso2ooo.odt!) tries not to overwrite already existing documents. So running mso2ooo twice will be OK.
Almost all of the conversion code (and the idea, as well) was taken from an XML.com article, which was taken from an OpenOffice.org forum posting.
UPDATE
On Nov 5 Adam Goodfriend wrote me an email:
Thank you for your work on the mso2ooo converter, I have found it very helpful. I was also looking for a tool to take ODF files and convert them to Microsoft office files so I edited your macro to allow for this. Attached are my changes to your file, please feel free to edit it or post it on your site.
Thanks Adam! I am happy to help :) you can download his attachment.
35 comments
Hi,
Can I change the macro to convert to another formats??
Changing the ms2000_config.txt to
NOT DO THIS.
Thanks!
I never tried to use it but supposedly it can be. If "txt" does not work, try "text" or something similar. If you really need the functionality, check OOo documentation (I'm not aware where it is).
I try "Text" sugested by rpmforge OO formats list, and many others... it produced a binary file, and, if I change extension to odt, IT IS A ODT file!
We need to change de MACRO at mso2ooo.odt (to add a new SaveAsTxt sub) , but the mso2ooo IS NOT EDITABLE.
Nice info. I never heard about this before.
I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. I think it may be help all of you. Thanks a lot for enjoying this beauty blog with me. I am appreciating it very much! Looking forward to another great blog. Good luck to the author! all the best!
Firstly, run mso2ooo.py. In Windows, you can run mso2ooo.py by opening clicking double-clicking it in Windows Explorer. In (my Ubuntu) Linux, you need to run python.This is a really good read for me. Must agree that you are one of the coolest blogger I ever saw. Thanks for posting this useful information. This was just what I was on looking for. I'll come back to this blog for sure! I bookmarked this blog a while ago because of the useful content and I am never being disappointed. Keep up the good work.
I rеad thiѕ post сomplеtely abоut the cοmparison of latest and рrevіouѕ technοlogies,
it's remarkable article.
Now lets talk about free strippers. Went to the strip club the other day
and some pretty nice babes where dancing down there. One
is a well known actress on this web site. Told me to
check it out. I downloaded her show. I'm glad I did. Really amazing stuff guys!
UPDATE: see the lower portion of the post for update. Thanks Adam!
Can I do:
source: odt ods
to: doc xls
can this be used to convert to pdf ?
thanks.
Thanks for your script, Leon. I have encountered a problem with it, though. If and of the doc files are corrupted and can't be opened in OpenOffice, the macro crashes. I see there is some error trapping in the section coverting docs to odt's, but I don't know enough about macro programming (I know a little Python) to know what it's supposed to do. It seems to want to carry on and add the failed doc to a message list, but it won't do that for me.
Looking for some information to increase my knowledge. I get one here. Thanks.
I don't actually know what will be the exact solution of this kind of particulars. But you can try different ways to solve it as well. But you should choose more authentic solution if there is not damage your valuable PC.
I`m not into script writing, and don`t understand how it works, but is it possible to use this to "Bulk Convert" Microsoft Publisher 98 files, with the extension .pub into Open Office readable files?
Converstion of micro soft document Image File to PDF
Converstion of micro soft document Image File to PDF
Really interesting information. Good job.
Really useful information. Thanks.
Thanks for the nice blog. It Was Very useful for me. Keep such sharing ideas in the Future as well. Actually This Was What I Was looking for, and I am glad to cam here! Thanks for sharing the information with us such.
Thanks for the nice blog. It Was Very useful for me. Keep such sharing ideas in the Future as well. Actually This Was What I Was looking for, and I am glad to cam here! Thanks for sharing the information with us such.
Excellent stuff from you, man. I’ve read your things before and you are just too awesome. I adore what you have got right here. You make it entertaining and you still manage to keep it smart.This is truly a great blog thanks for sharing
it is really refreshing to see a music artist who is real and didnt let him becoming a star going to his head i not really in to rapp but i like his song maybe it is because they lyrics are so downto earth.
I agree with your conclusions and will eagerly look forward to your incoming updates. Just saying thanks will not just be adequate, for the wonderful clarity in your writing.It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing
seragam sekolah
pupuk organik
What a wonderful idea! That’s a perfect way to honor your children and have a beautiful design as well. I’m really interested in hearing how much the design of the star means to people.
I've lost all of my Microsoft programs (which I'd rather not use anyway) but I have a couple of old Microsoft Database programs that I can no longer access; any tips?
To say the truth I am very impressed by what you told. You share tons of interesting info, neat and excellent design you’ve got here. It’s certainly one of the most informative stuff on this topic I’ve ever read.
i think this post is greater post then another because its short but effective and impressive content which give the best knowledge.
pupuk organik
seragam sekolah
seragam
konveksi
pria paling ganteng di cianjur
pria paling ganteng secianjur
I am very enjoyed for this blog. Its an informative topic. It help me very much to solve some problems. Its opportunity are so fantastic and working style so speedy. I think it may be help all of you. Thanks a lot for enjoying this beauty blog with me. I am appreciating it very much! Looking forward to another great blog. Good luck to the author! all the best!
I don't actually know what will be the exact solution of this kind of particulars. But you can try different ways to solve it as well. But you should choose more authentic solution if there is not damage your valuable PC.
I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end. I would like to read newer posts and to share my thoughts with you
sunglasses shop
I take to coming defeat daily to conscious of your thoughts. I have your page bookmarked on my daily comprehend heel!
http://www.simplyrest.com/airbeds
However, she’s too divisive to garner the support needed to mount a credible challenge. showing us all different sides to it. You are a great writer. Please keep it up. I can not wait to read what is next. http://www.templatesspot.com/category/blog-magazine/
teke it agen togel
togel
singapore pools
Post new comment