Let me brief out the scenario:
- We have base64 encoded .docx file.
- Our Word Add-in has a functionality in which we request in-house API to get base64 encoded .docx file.
- This base64 encoded .docx file (which has header, footer and body) is loaded in MS Word using Word Add-in.
- The problem is document body is loaded perfectly, but header and footer are not loaded in MS Word.
- Office JS API which is used to do above is Document.Body.insertFileFromBase64().
Steps are explained with proper screenshots:
Step – 1
Create a sample data document with header and footer details, as shown in screenshot.
Step – 2 Get Base64 encoded file string of above .docx file.
Step – 3
We have created an angular js 1.7 and angular 6 Office JS Add-in application, which accepts .docx base64 encoded file string and load that file inside MS Word.
3.1 Angular 6 Office JS Add-in application is as below:
3.2 We input base64 encoded file string from Step – 2 into textbox shown in custom Word Add-in developed by us. On clicking load file button our add-in loads actual file from base64 encoded string.
3.3 As shown in below screenshot, header and footer are vanished and only body is loaded in MS Word.
3.4 Office JS API used in custom Word Add-in developed is context.Document.Body.insertFileFromBase64(, )
Office JS API CDN: https://appsforoffice.microsoft.com/lib/1/hosted/Office.js
Please help on this, as we are blocker state for production issue in our application.