对于单词JavaScript添加,当用户单击“功能区”按钮执行命令时,打开一个空窗口“开发人员”窗口。命令完成后( event.completed()
),它保持打开状态。
它基于Office添加命令的示例:
是否可以:
- 不打开窗口而是执行命令?
- 还是在执行命令之后直接关闭它?
- 还是在命令完成后关闭它? (
window.close()
似乎不起作用)
For a word javascript add in, an empty window "Window of developer" opens when the user is clicking on the ribbon button to execute the command. It remains open after the completion of the command (event.completed()
).

It is based on the sample of office add in commands:
https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/office-add-in-commands/word
Is it possible to:
- not open the windows but execute the command ?
- or close it directly after but execute the command ?
- or close it after the command is completed ? (
window.close()
seems not working)
发布评论
评论(1)
这是开发人员窗口,仅在加载程序在Mac上没有UI时才在开发人员模式下出现,并且可用于通过右键单击 + Inspect将调试器附加到加载项。 https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-found-office-add-ind-ind-in-in-in-ipad-and-mac-mac 有更多详细信息。必须手动打开开发人员模式,但是要将其禁用,以便您没有弹出窗口,可以在终端和重新启动Word中运行命令“ defaults delete delete delete delete com.microsoft.word officewebaddindeveloperextras”。如果您没有通过终端手动启用开发人员模式,则用于开发加载项的一些VS代码模板也可能为您设置此键。
This is the developer window that only appears when in developer mode when add-in has no UI on Mac, and can be used used to attach debugger to an add-in through right click + inspect. https://learn.microsoft.com/en-us/office/dev/add-ins/testing/debug-office-add-ins-on-ipad-and-mac has more details. Developer mode has to be manually turned on, but to disable it so that you don't have the popup you can run the command "defaults delete com.microsoft.Word OfficeWebAddinDeveloperExtras" in terminal and restart Word. Some of the VS code templates for developing add-in may also set this key for you if you didn't manually enable developer mode through terminal.