How to merge multiple documents into one with Writer

Discuss the word processor
Post Reply
backwards
Posts: 7
Joined: Fri Jan 25, 2008 1:05 am

How to merge multiple documents into one with Writer

Post 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?
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: how to merge multiple documents into one with Writer

Post 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
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: how to merge multiple documents into one with Writer

Post 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.
AOO4/LO5 • Linux • Fedora 23
User avatar
floris v
Volunteer
Posts: 4422
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: How to merge multiple documents into one with Writer

Post 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.
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
backwards
Posts: 7
Joined: Fri Jan 25, 2008 1:05 am

Re: How to merge multiple documents into one with Writer

Post 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?
Dave
Posts: 1011
Joined: Sun Dec 23, 2007 6:53 pm

Re: How to merge multiple documents into one with Writer

Post 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.
gummiente
Posts: 1
Joined: Thu Sep 19, 2013 9:40 pm

Re: How to merge multiple documents into one with Writer

Post 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.
OOO 3.3 / Ubuntu 10.04
Post Reply