【问题标题】:MS Outlook 2016 Ribbon Scaling issuesMS Outlook 2016 功能区缩放问题
【发布时间】:2019-05-24 10:13:56
【问题描述】:

当 Outlook Explorer 或 Inspector 窗口的宽度减小时,功能区会发生变化。在我的 VSTO 插件中,我可以影响 Office 功能区的缩放方式吗?

在某个宽度处,选项卡会变成带有小箭头的单个图标,单击该图标时,选项卡的按钮/元素会出现在弹出窗口中。在这种情况下如何设置出现的图标?

下面是我当前用于标签的 XML。

我还添加了一张当窗口变窄时我的功能区看起来如何的图片。

我无法从 Microsoft 找到新的 XML 标记,这真的是最新版本吗[MS-CUSTOMUI2]: Custom UI XML Markup Version 2 Specification

<tabs>
<!-- Creates a new App Tab on the inspector toolbar-->
<tab idMso="TabReadMessage">
  <group id="AppGroup" label="App">
    <!-- A toggle or ON/OFF button to Encrypt or Decrypt an email and show the current encryption -->
    <toggleButton id="insDecryptButton"
        getLabel="insDecryptButton_getLabel"
        size="large"
        onAction="insDecryptButton_ButtonClick"
        getImage="insDecryptButton_getImage"
        getSupertip="insDecryptButton_getSupertip"
        getScreentip="insDecryptButton_getScreentip"
        getPressed="insDecryptButton_getPressed"
                  getVisible="insDecryptButton_getVisible"/>

    <!-- A Button with drop down that shows all the File Numbers in the Email. If there are no file numbers this will not appear. -->
    <dynamicMenu id="insMenu"
               getLabel="insMenu_getLabel"
               size="large"
               getImage="insMenu_getImage"
                 getVisible="insMenu_getVisible"
                 getSupertip="insMenu_getSupertip"
                getScreentip="insMenu_getScreentip"
               getContent="insMenu_getContent"/>

    <!-- Button to upload the email or attachments to IPAS -->
    <dynamicMenu id="upMenu"
               getLabel="upMenu_getLabel"
               size="large"
               getImage="upMenu_getImage"
                 getVisible="upMenu_getVisible"
                 getSupertip="upMenu_getSupertip"
                getScreentip="upMenu_getScreentip"
               getContent="upMenu_getContent"/>
  </group>
</tab>

【问题讨论】:

  • 您也可以使用getImage 将图像分配给组。
  • 谢谢。我在选项卡中搜索某些内容并忽略了 group 元素。如果您愿意,请将您的评论作为答案。
  • 别担心,伙计。很高兴我能帮上忙。如果有帮助,我在 GitHub 中有一堆 VSTO 插件示例。 github.com/aduguid

标签: outlook vsto ribbonx


【解决方案1】:

Office 应用程序自行执行缩放优化。没有新的架构。相反,正如其他海报所注意到的,您需要为所有 group 控件提供 getImage 回调。它应该是这样的:

 C#: IPictureDisp GetImage(IRibbonControl control)
 VBA: Sub GetImage(control As IRibbonControl, ByRef image)
 C++: HRESULT GetImage([in] IRibbonControl *pControl, [out, retval] IPictureDisp ** ppdispImage)
 Visual Basic: Function GetImage(control as IRibbonControl) as IPictureDisp

调用InvadiateInvalidateControl 可能会显示一个新图像(因此,您的回调将被调用)。

在以下文章中了解有关 Fluent UI(又名 Ribbon UI)的更多信息:

如果您想了解有关动态自定义的更多信息,可以查看:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-01
    • 2017-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-19
    相关资源
    最近更新 更多