Hey everyone, I’m trying to figure out if there’s a way to add the contents of one Google Doc into another. I know in Microsoft Word you can use something called an IncludeText field, but I can’t find anything similar for Google Docs.
Here’s what I’m trying to do: I have a custom header that I want to use in all my documents. It would be great if I could just type {{header}} at the top of each file and have it automatically pull in the content from another doc. That way, if I need to update the header, I only have to do it in one place.
I tried writing a Google Apps Script that copies the current doc and replaces {{header}} with text from another doc. But it only works with plain text, and I need to keep the formatting, tables, and images.
Has anyone found a good way to do this? Or am I going to have to write a more complicated script to handle all the different element types? Any tips would be super helpful!
I’ve been in a similar situation and found a decent workaround using Google Docs’ ‘Linked objects’ feature. Here’s what I do:
Create your header in a separate Google Drawing. In your main document, go to Insert > Drawing > From Drive and select your header drawing. This inserts the header as a linked object.
The beauty of this method is that when you update the original drawing, you can refresh the linked objects in all your docs to update them. It’s not fully automatic, but it’s pretty close and maintains formatting, images, etc.
One caveat: it works best for headers that don’t change size often, as you might need to adjust the drawing’s size in each doc if it changes significantly. Still, it’s been a time-saver for me compared to manual copying and pasting.
While Google Docs doesn’t have a native feature like Word’s IncludeText, there are workarounds. One approach is using Google Apps Script, but as you’ve found, it can be complex to maintain formatting.
An alternative is to use the ‘Insert > Building blocks > Template’ feature. You can create a template with your header and reuse it across documents. This preserves formatting and updates automatically when the template changes.
For a more dynamic solution, consider using add-ons like ‘Docs to Merge’ or ‘Document Studio’. These allow you to pull content from other docs while maintaining formatting.
Ultimately, the best method depends on your specific needs and technical comfort level. Each approach has trade-offs in terms of ease of use versus flexibility.
have u tried using the ‘copy and paste’ method? it’s not automatic but it works for me. just open both docs side by side, copy the header from one and paste it into the other. u can update it manually when needed. not perfect but gets the job done without complicated scripts