Word add-in (office-js) - createDocument function not working as expected in Word online
我有一个Word加载项,它试图使用createDocument()函数在运行时创建一个新文档,然后将其打开。 这在桌面上的Word上运行良好。 但是,使用Google Chrome在Word Online中运行时,会出现一条消息:
"This add-In is about to create a new document in your default folder
on your current cloud repository."
但是没有创建文档。 在Chrome开发者控制台中,出现一条消息:
"Sorry, something went wrong. Check the
OfficeExtension.Error.debugInfo for more information."
在其他浏览器中,收到此提示后,将出现有关该加载项的另一个提示,即打开一个新窗口,此后该文档将按预期显示。
根据文档,我正在将base64编码的文档传递给函数。 有问题的代码是这样的:
1 2 3 4 5 6 7 | 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(); }); |
所以我的问题是:这是OfficeJS库中的错误还是Chrome中的错误,还是我需要做一些其他事情(未记录的问题)以使其在这种情况下正常工作?
@ msft-jipyua,我只是擦洗,但可以在这里确认问题。 当我从Google Chrome浏览器中的在线单词调用自动打开功能时,看到的图像就是附件。 不知道为什么它不起作用..抱歉没有答案,但这是我可以添加到这篇文章的唯一方法
看到错误消息,javascript控制台