Combine word documents libreoffice

Post by backwards » Tue Sep 23, 2008 4:50 am

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?

Villeroy Volunteer Posts: 31307 Joined: Mon Oct 08, 2007 1:35 am Location: Germany

Re: how to merge multiple documents into one with Writer

Post by Villeroy » Tue Sep 23, 2008 3:10 pm

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

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 » Tue Sep 23, 2008 4:26 pm

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 floris v Volunteer Posts: 4464 Joined: Wed Nov 28, 2007 1:21 pm Location: Netherlands

Re: How to merge multiple documents into one with Writer

Post by floris v » Tue Sep 23, 2008 7:28 pm

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 » Tue Sep 23, 2008 10:16 pm

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'.

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 » Wed Sep 24, 2008 12:44 am

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?

gummiente Posts: 1 Joined: Thu Sep 19, 2013 9:40 pm

Re: How to merge multiple documents into one with Writer

Post by gummiente » Thu Sep 19, 2013 9:42 pm