question

CorGri-1567 avatar image
0 Votes"
CorGri-1567 asked

Addin word : Load header and footer from base64 file

Hi,

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?


Thanks.

office-addins-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers