Addin word : Load header and footer from base64 file

Viewed 69

I have a .docx encoded in base64 and I try to put this document in a blank Word with my Word Adding tool. (WordApi 1.3 / Angular 7)

I already tried to use context.document.body.insertFileFromBase64(this.myFileBase64, Word.InsertLocation.replace); but it doesn't include my header nor footer (of course, it's only loading the body).

Then I tried to get this header from another document using context.document.sections.getFirst().getHeader("Primary"); but it doesn't work neither

The only way I find was to load my base64 file in a new Word instance, but it's closing my addin and erasing my settings

  let docWord:Word.DocumentCreated;
  docWord = app.createDocument(this.myFileBase64);
  docWord.open();

Can I load the entire Word file (header body footer) in a Word document ?

Is there a way to load/reload my base64 file into a Word instance ?

Cross posted here.

Thanks.

0 Answers
Related