mso2ooo - Batch Convert Microsoft Office Documents to OpenOffice Documents

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 download1 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:

  1. configure anything in mso2ooo_config.txt
  2. run mso2ooo.py
  3. run mso2ooo.odt

Conversion is done in two steps2: 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.

1 I know that OpenOffice.org everywhere includes a Python implementation by default, including in Windows, but I can’t make it work. Sorry but currently you need to download the whole Python for Windows.

2 If someone could make the equivalent of mso2ooo.py in OpenOffice.org Basic, it would be just one step. Or integrate mso2ooo.py in mso2ooo.odt (OpenOffice.org documents can contain Python scripts, it’s just I can’t do it). This also solves the problem of Python in Windows.

AttachmentSize
mso2ooo.zip15.88 KB
mso2ooo (from Adam Goodfriend).zip16.89 KB

62 comments

convert to txt or xhtml .

Hi,
Can I change the macro to convert to another formats??
Changing the ms2000_config.txt to

convert_from = doc

convert_to = txt

NOT DO THIS.
Thanks!

I never tried to use it but.

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).

doc2txt convertion.

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.

Thanks.

Nice info. I never heard about this before.

very good.

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!

you are really committed to.

you are really committed to changing your lifestyle and getting in shape. If you are prepared to make some simple changes you'll see (and feel) the results in just a few weeks. Before you embark on any serious diet and exercise program however, it's always a good idea to check with your physician first.

very good.

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.

When deciding on an attorney,

When deciding on an attorney, it is important to have a full understanding of the fees. Ask how many attorneys will be working on your case and the hourly rates of each. Inquire about whether any projects are billed as a flat fee-this can help you plan your budget more accurately. In some instances, flat fees may not be feasible, such as in a negotiation with another party or a merger or acquisition.

Reply to comment | Leap On!

I rеad thiѕ post сomplеtely abоut the cοmparison of latest and рrevіouѕ technοlogies,
it's remarkable article.

Reply to comment | Leap On!

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!

Are you planning to launch a.

Are you planning to launch a social media campaign to promote your business soon? Then you definitely need to plan well ahead of time. And one of the most important tasks that you have to take care of in the planning phase is to decide just how responsive you are going to be on various social media networks during the campaign.

THANKS FOR SUPPORT.

i have read ur comment, and i very interesting thanks
sewa mobil
alat bantu sex

UPDATE: see the lower.

UPDATE: see the lower portion of the post for update. Thanks Adam!

odt ods TO doc xls.

Can I do:

source: odt ods
to: doc xls

can this be used to convert.

can this be used to convert to pdf ?

thanks.

mso2ooo.odt macro.

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.

Great Post.

Looking for some information to increase my knowledge. I get one here. Thanks.

Are U Sure.

Actualy I Agree With Ur Statemant :D So how about u ?
Sbobet

very good.

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.

changing MS Publisher documents file extension .pub to O.O.

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?

Convertion .

Converstion of micro soft document Image File to PDF

amikom.us tempat belanja hosting murah.

Converstion of micro soft document Image File to PDF

Xtreme No Review.

Really interesting information. Good job.

Mobil keluarga terbaik di Indonesia.

Really useful information. Thanks.

Pingback. [...] pad 2 bachelor pad 2 nfc dow jones weather nyc shaq xom This entry was posted in thundering and tagged anxiety by gravao. Bookmark the [...]
Thanks for the nice blog. It.

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.

leo.

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.

great post.

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

shakha.

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.

nice blog.

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

shahazada.

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.

conversion wdb to open office.

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?

shakha.

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.

great post.

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

very good.

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!

very good.

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.

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.

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.

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/

My wife and i thanks for.

My wife and i thanks for thoughts.Write about your entire information and then stbookmarking show ory here in the review element.Leave an actual annotate down below not to mention shift your actual. Go to individual websites online: agen bola and agen sbobet also agen ibcbet

My wife and i we appreciate.

My wife and i we appreciate you say.Easily share all your understanding and so stbookmarking list ory here inside the thought sections.Make an idea what follows in addition to reduction your current. Visit your places: casino sbobet and agen ibcbet and agen sbobet also agen bola

That i appreciation for.

That i appreciation for note.Display your own knowledge combined with stbookmarking collection ory around throughout the say chapter.Write a very note followed below and furthermore shift an individual's. Take a look at your internet websites: Ship Building and ShipBuilder also Shipbuilding and Shipbuilder

When i thanks for.

When i thanks for note.Readily share your individual wisdom and therefore stbookmarking opt-in list ory around through the provide feedback phase.Go away the remark further down and consequently get rid of your own personal. Go to see my own, personal web pages: Obat Kuat and Pembesar Payudara and Alat Bantu Sex also Pembesar P enis

Document i appreciate you for.

Document i appreciate you for message.Share your new know-how and also stbookmarking shortlist ory around in the comments sentence.Go out of an actual comments followed below and consequently reduction any. Pay a visit to a good niche sites: Obat Aborsi and Obat Perangsang and Obat Kuat also Alat Bantu sex

Steer clear of junk foods. It.

Steer clear of junk foods. It is recommended that you store the border of the neighborhood food store in case you have diabetes. This means you must adhere to refreshing meals. Go shopping for new vegetables and fruit, new meat, clean baked goods. Steer clear of foods which are extremely processed. Should you do purchase processed food, carefully see the elements Mainan Sex Dewasa, Obat Perangsang Wanita, Vakum Payudara, Obat Perangsang, Obat Kuat Pria,

Obat Perangsang Wanita, thanks

experience great things.

I believe this really is one of the most significant info for me personally. And i'm glad reading your article. But wish to remark on few general things, The web site style is perfect, the articles is actually great : D. Good job, cheers…Come and Try to Play Sbobet Now. Enjoy the game

sbobet.

Your website provided us very useful information in order to work of art. You've carried out the most remarkable exercise as well as the whole community which is more grateful in order to you.
Sbobet

Very Useful.

This tool works great. I got fed up with LibreOffice and was able to get MS Office cheaply through my school, but I already had created lots of documents in LO. This saved me the hassle of doing it manually.

I did notice one strange thing. When converting my documents, the macro document hung until I opened the first document it was trying to convert. Then the rest converted automatically.

I've also taken the liberty to update your script to work with Python 3. Here it is: http://sdrv.ms/1dkxAKy

I am so much excited after.

I am so much excited after reading your blog. Your blog is very much innovative and much helpful for any industry as well as for person.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre> <i> <b>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Recent comments