如何在 Office `Dialog API` 中使用 `Word.run(function (context) {`

How to use `Word.run(function (context) {` in Office `Dialog API`

我正在使用 Word AddIn 进行开发,我想在 Dialog API 中使用 Word.run(function (context) {,但我总是遇到内部服务器错误的异常 general exception。没有附加消息。

错误:

Debug info: {"code":"GeneralException","message":"An internal error has occurred."}

您不能在对话框中使用 Word.run。

messageParent 函数是仅有的两个可以在对话框中调用的 Office API 之一。另一个是Office.context.requirements.isSetSupported。 messageParent函数只能在与宿主页面同域(包括协议和端口)的页面上调用。

我从文档中得到了这个信息:Use the Dialog API