How to preserve formatting when using getText() method in Google Docs using App Script / Javascript

99 views Asked by At

The code below pulls in text from a file. I want to pull all the text from this file, and the text from this source file is formatted in bullet points.

var autoPay = DocumentApp.openById("[file ID]");

autoPay_text = autoPay.getBody().getText();

body.replaceText("{{AddedFeatures}}",autoPay_text);

How do I preserve the bullet points format when the text is placed in the destination file? Is there a method for this, or do I have to do something dreadful like creating an array?

0

There are 0 answers