From bf80311ef73b8db5c1ac67b41c51a3855b6f959a Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Sun, 7 Jul 2019 20:23:42 +0100 Subject: [PATCH] Add new section method --- src/file/file.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/file/file.ts b/src/file/file.ts index 0f4c77c82b..a78acd86e6 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -185,6 +185,14 @@ export class File { this.document.Body.addSection(sectionPropertiesOptions); } + public addSection(section: ISectionOptions): void { + this.document.Body.addSection(section.properties); + + for (const child of section.children) { + this.add(child); + } + } + public createFootnote(paragraph: Paragraph): void { this.footNotes.createFootNote(paragraph); }