diff --git a/src/file/file.ts b/src/file/file.ts index 3bf43eb9d7..81920a2ad2 100644 --- a/src/file/file.ts +++ b/src/file/file.ts @@ -53,6 +53,10 @@ export class File { this.footNotes = new FootNotes(); this.contentTypes = new ContentTypes(); + if (fileProperties.template) { + this.currentRelationshipId = fileProperties.template.currentRelationshipId + 1; + } + if (options.externalStyles) { const stylesFactory = new ExternalStylesFactory(); this.styles = stylesFactory.newInstance(options.externalStyles); @@ -63,10 +67,6 @@ export class File { this.addDefaultRelationships(); - if (fileProperties.template) { - this.currentRelationshipId = fileProperties.template.currentRelationshipId + 1; - } - if (fileProperties.template && fileProperties.template.headers) { for (const templateHeader of fileProperties.template.headers) { this.addHeaderToDocument(templateHeader.header, templateHeader.type);