I have a word add-in which fetches an external document, and then opens the base64 encoded string of the new document. However, currently the new document is opened in a new instance/tab of word. The document is opened with the title - Compatibility Mode.
Instead, I want the document to open in the current instance of word. i.e. saving and closing the current document and opening the new document, meaning that 1 instance of word is only ever open.
After I have retrieved the base64 encoded document from the server, I then perform the following to open the document:
Word.run(function (context) {
// Create a new document from the base64 string
context.application.createDocument(base64_document).open();
return context.sync();
}).catch(function (myError) {
throw myError.message;
});
How can I ensure that this document is opened in the current Word window?