How to flush a document in Google Apps Script Document Service? Do I need to loop through all the kind of elements e.g. paragraph, image, table and remove them as a child? Is there an easier way to delete everything in the body of a document?
Thank you!
According to the Documentation, the Document.setText
should be able to clear the document content. I assume the following command should do it.
doc.setText('');
In the current Document of google apps script as doc.setText method is not available this could be achieved by doc.getBody().clear()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With