我们可以在 yo office 生成的 Outlook 加载项中使用 PrimaryCommandSurface

问题描述

有什么方法可以使用 PrimaryCommandSurface 在 Outlook 插件开发中的顶部 Ribbon 上显示插件,如果是,请帮助更新有效的 manifest.xml。

如果没有帮助其他方式如何创建outlook top Ribbon 命令插件

<ExtensionPoint xsi:type="PrimaryCommandSurface">
          <CustomTab id="Contoso Tab">
          <!-- If you want to use a default tab that comes with Office,remove the above CustomTab element,and then uncomment the following OfficeTab element -->
            <!-- <OfficeTab id="TabData"> -->
            <Label resid="residLabel4" />
            <Group id="Group1Id12">
              <Label resid="residLabel4" />
              <Icon>
                <bt:Image size="16" resid="icon1_32x32" />
                <bt:Image size="32" resid="icon1_32x32" />
                <bt:Image size="80" resid="icon1_32x32" />
              </Icon>
              <Tooltip resid="residToolTip" />
              <Control xsi:type="Button" id="Button1Id1">

                  <!-- information about the control -->
              </Control>
              <!-- other controls,as needed -->
            </Group>
          </CustomTab>
        </ExtensionPoint>

      <ExtensionPoint xsi:type="ContextMenu">
        <OfficeMenu id="ContextMenuCell">
          <Control xsi:type="Menu" id="ContextMenu2">
                  <!-- information about the control -->
          </Control>
          <!-- other controls,as needed -->
        </OfficeMenu>
        </ExtensionPoint>

解决方法

PrimaryCommandSurface 代表 Office 中的功能区。在 Outlook 的情况下,我们处理读取或撰写项目,因此我们应该对接收的项目使用 MessageReadCommandSurface,例如:

<ExtensionPoint xsi:type="MessageReadCommandSurface">
  <OfficeTab id="TabDefault">
        <-- OfficeTab Definition -->
  </OfficeTab>
</ExtensionPoint>

TabDefault 是 Outlook 中内置选项卡的 idMso 值。

您还可以通过以下方式将控件放入自定义选项卡中:

<ExtensionPoint xsi:type="MessageReadCommandSurface">
  <CustomTab id="TabCustom1">
        <-- CustomTab Definition -->
  </CustomTab>
</ExtensionPoint>

如果您需要为 Outlook 中的组合项目显示功能区 UI,您需要使用 MessageComposeCommandSurface 扩展点,该扩展点将按钮放在功能区上以使用邮件撰写表单加载项:

<ExtensionPoint xsi:type="MessageComposeCommandSurface">
  <OfficeTab id="TabDefault">
        <-- OfficeTab Definition -->
  </OfficeTab>
</ExtensionPoint>

并将控件放入自定义选项卡:

<ExtensionPoint xsi:type="MessageComposeCommandSurface">
  <CustomTab id="TabCustom1">
        <-- CustomTab Definition -->
  </CustomTab>
</ExtensionPoint>

有关详细信息,请参阅 ExtensionPoint element

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...