I have N Word documents (Office 2003) from which I want to make a single Word document by merging all the N documents together in some order. How do I go about doing this in Ruby? Thanks!
It's just the documents that are created in MS Office. I do not use Windows and would prefer non-Windows solutions.
EDIT: Will this be easy if the docs are odt files rather than doc files?
The only non-Windows solution that I know of is Ruby bindings in POI. After that, the code would be really similar to to this .NET code: Merge Word Documents As Pages Of A Single Document Using VB.NET. The key code you'll want is to use Selection.InsertFile
for as many doucments as you need in the order you choose.
For ODT document merges, see this thread: http://cpanforum.com/threads/9938
There is a whole series of really good articles about word and ruby at http://rubyonwindows.blogspot.com/search/label/word. Word files are really complicated, at least before 2007, so you're better off automating word to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With