I built an app script to copy a doc and edit it based upon the data I have entered into a Google spreadsheet.
Once the doc is copied and edited, I would like to remove certain text paragraphs.
I was using the following to see if I could find the position of the
text I was searching for, but my code returned Range Element.
var body = DocumentApp.openById(copyID).getBody();
var para = body.findText('X1');
Logger.log(para);
My ideal state would be to provide apps script with two positions within the document, and then have Apps Script delete all the text within that range.
How can I generate the correct offsets and delete the text?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…