I have a Word add-in which is trying to use the createDocument() function to create a new document at runtime and then open it. This works fine on Word on the desktop. However, when running in Word online using Google Chrome, a message appears:
"This add-In is about to create a new document in your default folder on your current cloud repository."
But no document is created. In the Chrome developer console, a message appears:
"Sorry, something went wrong. Check the OfficeExtension.Error.debugInfo for more information."
In other browsers, after receiving this prompt another prompt will appear about the add-in opening a new window, after which the document will appear as expected.
As per the documentation, I'm passing the base64-encoded document to the function. The code in question goes like this:
Word.run(async context => {
var base64doc = fetchBase64(); // gets the base64 encoded document
const app = context.application; // get the app from the context
const newDoc = app.createDocument(base64doc);
newDoc.open();
await context.sync();
});
So my question is: is this a bug in the OfficeJS library, or with Chrome, or is there something else (something undocumented) that I should be doing to make it work properly in this instance?