Load documento from base64 string
I'm saving the documento to a DB extracting the base64 file with Office.context.document.getFileAsync, but I need the counterpart to load my document, I tried with thisDocument.body.insertFileFromBase64, but I't doesn't load layout setting, header, footer etc, I also tryed a method from the beta context.application.createDocument(base64file) but this opens a new instance of word and this does not fit mi app requirement, are there any other alternatives? can this be done with and add-in?
Arfan Baig commented
Hi - When we open the document via context.application.createDocument(base64string).open(), it launches a new window.
Here is my use case:
1. Check if there is already an open document and ask the user to save or lose changes.
2. Have an API like this to close the already open document.
3. Open the new document via context.application.createDocument(base64string).open(), so that the document is opened in the current window instead of opening in a new instance of word.
Is there any workaround to achieve this?
Priyanka Nirmale commented
We are also face same issue. Header and footer are not getting load after insert base64 string by using "thisDocument.body.insertFileFromBase64(base64)"
We are using standard base64 string to load .docx file content. Then still facing same loading issue of header/footer.
Dalibor Grudenić commented
I have a same problem were you able to find any other workaround. Not sure even what is the use case scenario for insertFileFromBase64 if you can't get complete document with all the styles and header, footer etc...