How to open a document in 'current window' in office add-in instead of opening in a new window?

Viewed 346

I'm working on Office 365 Word Add-in that opens a document.

When we open the document via context.application.createDocument(base64string).open(), it launches a new window instead of opening the document in current browser tab (in case of web Add-in) or current instance of word (in case of windows Add-in).

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 to close the current open document e.g. context.document.close();

  3. Open a 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?

Cross posted here.

Thanks.

0 Answers
Related