Outlook加载项VSTO-挂钩进入现有按钮的单击
我目前正在尝试开发一个 Outlook 插件来扩展现有的功能。为了让它工作,我需要连接到现有按钮的 On-Click-Event(我有它的 IdMso),并执行其他代码。这可能吗?如果可能的话,如何实现?我使用 C# 作为编程语言。
I'm currently trying to develop an Outlook Add-In that extends an already existing function. To get it work, I need to hook into the On-Click-Event of an existing button (I have the IdMso of it), and execute additional code. Is that possible, and if so, how? I'm using C# as programming language.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,可以重新调整内置控件的用途。功能区 XML 中的
commands
元素可以实现此目的,例如:此示例使用 command 元素创建对 Microsoft Office 中保存文件功能的引用。您可以通过使用 idMso 属性来确定该组件是否包含 Microsoft Office 中内置的参考功能。
对于功能区按钮,回调如下所示:
对于
toggleButton
控件:请参阅 暂时重新调整 Office Fluent 功能区上的命令更多信息。
默认情况下,如果 VSTO 外接程序尝试操作 Microsoft Office 用户界面 (UI) 但失败,则不会显示错误消息。但是,您可以将 Microsoft Office 应用程序配置为显示与 UI 相关的错误消息。您可以使用这些消息来帮助确定为什么不显示自定义功能区,或者为什么显示功能区但不显示控件。请参阅 如何:显示加载项用户界面错误了解更多信息。
Yes, it is possible to repurpose built-in controls. The
commands
element in the ribbon XML can do the trick, for example:This sample creates a reference to the save file functionality in Microsoft Office by using the command element. You can determine that this component includes a reference functionality built into Microsoft Office through its use of the idMso attribute.
For ribbon buttons the callback looks like that:
And for the
toggleButton
control:See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.
By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear. See How to: Show Add-in user interface errors for more information.