> Hey,
>
> Here are some hints:
> - use win32ole, browse some examples
> - you'll probably instruct word to open a document, then save it as
> rtf. Record a macro in word that does this, then look at it in the macro
> editor. It will contain the calls that open and close documents :) These
> are the same functions you will use in Ruby, with the occasional change in
> punctuation. Let Ruby read the filenames, instruct Word to convert them.
>
> Danny

Recording a macro is a really good idea.  You may want to let Ruby call the
macro, rather than recording the macro and then porting it to Ruby.  But VBA
code will let you use named parameters, something Win32OLE (pretty sure)
won't allow. Just make sure the macro really does what you want (e.g., that
it doesn't save every file with the same name as the one used to record the
macro).

Passing parameters to macros from external scripts can be, as I recall,
tricky.  You can set custom document properties and have the macro use those
values, though.

Here are some more hints:

Make sure Word is configured to *not* prompt for saving changes or otherwise
ask for input before executing commands. Scripts can get hung if Word throws
up an unseen dialog box.

Plan well for exceptions.  If Word barfs on something and does not exit
correctly you may end up with zombie 'winword.exe' processes.

Be careful of default paths.  If at all possible try to use fully-qualified
file paths.



James