执行命令时如何隐藏打开的窗口?

发布于 2025-02-03 05:24:06 字数 662 浏览 3 评论 0 原文

对于单词JavaScript添加,当用户单击“功能区”按钮执行命令时,打开一个空窗口“开发人员”窗口。命令完成后( event.completed()),它保持打开状态。

它基于Office添加命令的示例:

是否可以:

  1. 不打开窗口而是执行命令?
  2. 还是在执行命令之后直接关闭它?
  3. 还是在命令完成后关闭它? ( 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()).

window of developper

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:

  1. not open the windows but execute the command ?
  2. or close it directly after but execute the command ?
  3. or close it after the command is completed ? (window.close() seems not working)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

汹涌人海 2025-02-10 05:24:06

这是开发人员窗口,仅在加载程序在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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文