【问题标题】:How Can I save Ribbon Settings made in the Outlook Explorer Window and also display und use them in the Outlook MailItem Window?如何保存在 Outlook Explorer 窗口中进行的功能区设置并在 Outlook MailItem 窗口中显示和使用它们?
【发布时间】:2022-01-18 20:18:57
【问题描述】:

对于我的 Outlook 插件,我创建了一个带有 XML 和几个 OnAction 方法的功能区。 我的功能区有切换按钮,当被激活时启用多个功能。 我的问题是,如果用户单击 Outlook 资源管理器窗口功能区中的按钮,然后创建一个新邮件(打开 MailItem 窗口),则在资源管理器窗口功能区中所做的设置不会转移到MailItem 窗口的功能区。

这是资源管理器窗口的功能区:

这是 MailItem 窗口的功能区:

【问题讨论】:

    标签: c# outlook vsto outlook-addin ribbonx


    【解决方案1】:

    您需要为功能区上的toggleButton 控件指定getPressed 回调。它使您能够指定是否按下切换按钮控件。回调具有以下签名:

    C#: bool GetPressed(IRibbonControl control)
    
    VBA: Sub GetPressed(control As IRibbonControl, ByRef returnValue)
    
    C++: HRESULT GetPressed([in] IRibbonControl *pControl, [out, retval] VARIANT_BOOL *pvarfPressed)
    
    Visual Basic: Function GetPressed(control As IRibbonControl) As Boolean
    

    因此,当有人单击资源管理器窗口上的按钮时,您可以使用布尔变量保存状态(由您决定如何维护状态)并在 getPressed 回调中返回缓存值。

    在以下系列文章中阅读有关 Fluent UI(又名 Ribbon UI)的更多信息:

    【讨论】:

      猜你喜欢
      • 2011-02-21
      • 1970-01-01
      • 2012-07-03
      • 2019-10-11
      • 1970-01-01
      • 2011-07-25
      • 1970-01-01
      • 2015-07-10
      • 2012-11-17
      相关资源
      最近更新 更多