MS Word JavaScript API - 内容控件的事件处理程序
有没有办法在单击 Office-js 中的 contentControl 时触发函数?
我正在为 MS Word 编写一个加载项,并且已插入内容控件,这些控件将与我的加载项中的列表关联。我需要在单击内容控件时触发一个函数,以便我可以滚动到列表中的项目并突出显示它。
我找到了“Document.ContentControlOnEnter 事件(Word)”,这似乎是我正在寻找的内容,但我无法理解如何附加侦听此事件的事件侦听器。
我正在用打字稿反应编写插件。
Is there a way to fire a function when clicking on a contentControl in Office-js?
I am writing an add-on for MS Word, and I have inserted content controls, that will be associated with a list in my add-in. I need to fire a function when clicking on the content control, so I can scroll to the item in the list and highlight it.
I have found the "Document.ContentControlOnEnter event (Word)" which seems to be what I am looking for, but I cannot understand how to attach an event-listener that listens to this event.
I am writing the plugin in typescript react.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Word Web 加载项不为此提供任何内容。
UPD:您可能对onSelectionChanged 事件,当内容控件中的选择发生更改时触发。请注意,此事件以预览版形式提供,在生产环境中不可用。
Word web add-ins don't provide anything for that.
UPD: You may be interested in the onSelectionChanged event which is fired when selection within the content control is changed. Note, this event is provided as in preview and not availble in a production environment.