Sometime you may need to merge Google Documents together, when they are just two the task is pretty easy and involves a single copy and paste operation. In some situation where you have multiple documents to merge in a constant recurring way the copy and paste operation could become a tedious task and an huge waste of time.
For this reason I’ve created a Spreadsheet document that, with the help of Google Apps Script, will automate the Google Document merge operation for an unlimited amount of Google Documents.
First of all make a copy of the following Google Spreadsheet document: Merge multiple Google Documents
To merge Google Documents you need the Document ID for each of them. Getting the Document ID is pretty easy, just open the Google Document you want to merge and look at the browser address bar:
![]()
The ID of the document is the string between “../d/” and “/edit”, in this example the ID is: “1uWocGqA7Bifl61Vu8-TOWpALDHic8gbc5oCuZivZ1Dg”. All you have to do is to put this ID from cell A5 of the Spreadsheet document:

You can add an unlimited number of document ids, just put them vertically from cell A5. When you have finished inserting all the Document ID to merge run the menu item “Merge Documents -> Merge”:

As result of the execution a new Google Document file will be created inside your Google Drive folder “My Drive”:

Right now this solution doesn’t play nice with images contained inside Google Documents. In the merged document images will result broken. This is a known Google Apps Script bug, you can find more informations here: Google Apps Script Issue: 1612. As soon as Google engineers fix this bug the script should work with images without problems. The only option for you right now, if you need to merge documents that include images, is to “star” the issue 1612 on the issue tracker to speed up the possible resolution.
Happy scripting!


Marcello, on the #1612 issue you mention, there is a new comment with a workaround for the images issue, try to use this:
dest.appendImage(source.getImages()[0].copy().getBlob());
Hello Gabriel, Faustino Rodriguez pointed that out on Google+ there is a discussion running here. He said to be trying to make this workaround work and if he comes up with a solution he will share that.
Hi Marcello,
I made a copy of your spreadsheet but it doesn’t have the “Merge documents” menu, i’m wondering where is the issue.
Sometime the menu takes time to load just try to close and reopen your local copy.
It worked, thank’s Marcello, you’ve created a great tool.
A grateful thumbs-up. This saved me a lot of time, and will save me more in the future. Thanks!
Erik
I do not get a d and an edit. I have a key after the word key and before the #gid….I pasted this key code in but it does not merge my docs…any thoughts? Thanks!