Add header and footer to the output document if not already present
This commit is contained in:
parent
4b69914181
commit
594a0b41d7
8
Code.ts
8
Code.ts
@ -83,12 +83,12 @@ function generateForCurrentRow() {
|
||||
const out_doc = DocumentApp.openById(out_file.getId());
|
||||
|
||||
// Copy header
|
||||
out_doc.getHeader().clear();
|
||||
copySection(template_doc.getHeader(), out_doc.getHeader());
|
||||
if (!out_doc.getHeader()) out_doc.addHeader();
|
||||
copySection(template_doc.getHeader(), out_doc.getHeader().clear());
|
||||
|
||||
// Copy footer
|
||||
out_doc.getFooter().clear();
|
||||
copySection(template_doc.getFooter(), out_doc.getFooter());
|
||||
if (!out_doc.getFooter()) out_doc.addFooter();
|
||||
copySection(template_doc.getFooter(), out_doc.getFooter().clear());
|
||||
|
||||
const insert_point = template_doc
|
||||
.getBody()
|
||||
|
Reference in New Issue
Block a user