Search code examples
google-apps-scriptgoogle-docs

Is there a way to copy, preserving all formatting style, a document and insert it in another document?


I'm trying to write a GAS script that copy, preserving all formatting style, the paragraphs of a google text document and insert it in another document. Since I'd like to preserve all the formatting (eg, words in italic and bold) of the copied document, what is the best way to do this?


Solution

  • Using the method copy is a good strategy: var thesesElement = thesesDoc.getChild(k).copy(); Here de GAS documentation. The only thing isn't being preserved is the font style.