I would prefer HTML over RTF as your intermediary format, especially if going to ePub (which is just zipped HTML).
You can use OpenOffice to convert to HTML or RTF certainly. I think there's a way of making it do on the commandline, but I've never managed to get it to work. However, it's fairly easy with AbiWord (Ubuntu package abiword).
The following shell command will batch convert every .doc and .docx in a given folder to .epub (with AbiWord and calibe installed):
(Be careful of files ending in .html or .epub with the same names already in the same folder; I haven't bothered watching for them.)
Quote:
for i in *.doc ; do abiword --to=html "$i" ; ebook-convert "${i%.doc}.html" "${i%.doc}.epub" --output-profile="sony" ; done
|
I don't know much about *.chm files, but if AbiWord can open them (likely), changing *.doc to *.chm in the above will do the trick.