Page 1 of 1

How to merge multiple documents into one with Writer

Posted: Tue Sep 23, 2008 4:50 am
by backwards
I have a bunch of odt files that I need to merge into 1 document. Is there a way to batch merge multiple documents at once in Writer? There's over 200 total documents so it's not really feasible for me to copy and paste each one individually. I would also like to make sure that the page margins and size are preserved when they're merged. Each individual document is meant to represent a single page so when they're merged each document needs to appear on a new page. Is this possible?

Re: how to merge multiple documents into one with Writer

Posted: Tue Sep 23, 2008 3:10 pm
by Villeroy
There is a concept of "Master documents" (File>New>Master...) with slave documents linked to it. But that concept is not self-explanatory (I don't get it by try and error): http://documentation.openoffice.org/man ... rGuide.pdf

Re: how to merge multiple documents into one with Writer

Posted: Tue Sep 23, 2008 4:26 pm
by acknak
I think you're in for a lot of mouse work, unless you prefer to write some kind of macro program.

Actually, it might not be so bad to do it by hand: get a list of all the file names, in order, in a text document. Select the file name and Edit > Cut. Then, Insert > File, paste the file name, OK. Type Ctrl+Enter to start a new page, cut the next file name, insert file... and so on.

You can record the Ctrl+Enter and Edit > Cut as a macro and assign it to a key if you want; you can't record the Insert > File because it will just insert the same file every time.

Re: How to merge multiple documents into one with Writer

Posted: Tue Sep 23, 2008 7:28 pm
by floris v
I haven't gone into it, but maybe there's a way to include all files in one folder if you can use an equivalent of findfirst and findnext in a macro. But it's a lot of work to figure that out and doing it manually may take less time.

Re: How to merge multiple documents into one with Writer

Posted: Tue Sep 23, 2008 10:16 pm
by backwards
I found a macro that can be used to combine multiple files but it isn't exactly what I'm looking for. You can download it by visiting the link below and clicking on 'Combine Files'.

http://sourceforge.net/project/showfile ... p_id=87718

The problem with this macro is that it doesn't preserve the page margins and size. I need it to treat each individual file as a separate page in the new document. With this macro you can create a page break after each file but they all appear on the standard 8.5 x 11 page size. There is also a bug in this macro when you use the 'Add a file' option. When you use the 'Add all files in directory' option everything seem to work fine though. Does anyone know of any similar macros to combine files?

Re: How to merge multiple documents into one with Writer

Posted: Wed Sep 24, 2008 12:44 am
by Dave
I think you can batch convert to PDF? Here's a site that explains somewhat. I have no pressing need, so I didn't read through it. However, if you can do that, there is software to join PDFs, and you might be able to take it from there?

David.

Re: How to merge multiple documents into one with Writer

Posted: Thu Sep 19, 2013 9:42 pm
by gummiente
OOOPY module (http://ooopy.sourceforge.net/) comes along with a script ooo_cat that merges as much odt-documents into a single one.