【问题标题】:Is it possible to create a Ribbon Tab in Office.js?是否可以在 Office.js 中创建功能区选项卡?
【发布时间】:2020-03-09 22:43:17
【问题描述】:

我正在尝试在 OfficeJS 中为 Windows Excel 创建自己的选项卡。我使用 Yeoman 生成器创建了一个测试应用程序,并尝试使用 CustomTab 和标签,但功能区上没有显示任何内容。我不确定我是否正确理解了 CustomTab 的使用。这是我的 XML

          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <CustomTab id="Tab.Home">
              <Group id="CommandsGroup">
                <Label resid="Tab.Label"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16"/>
                  <bt:Image size="32" resid="Icon.32x32"/>
                  <bt:Image size="80" resid="Icon.80x80"/>
                </Icon>
                <Control xsi:type="Button" id="TaskpaneButton">
                  <Label resid="TaskpaneButton.Label"/>
                  <Supertip>
                    <Title resid="TaskpaneButton.Label"/>
                    <Description resid="TaskpaneButton.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>
            </CustomTab>
          </ExtensionPoint>

【问题讨论】:

    标签: office-js office-addins excel-addins


    【解决方案1】:

    从这个 XML 中,您正在引用 Tab.Home,因此您的应用程序功能区位于“主页”选项卡上

        <CustomTab id="Tab.Home">
    

    如果你想创建一个新的功能区选项卡,你可以改变这一行:

        <CustomTab id="NewRibbonTab.Tab1">
    

    【讨论】:

    • 谢谢,我也意识到我必须在组下面放一个标签!
    猜你喜欢
    • 1970-01-01
    • 2013-08-24
    • 1970-01-01
    • 2014-09-02
    • 1970-01-01
    • 2017-07-21
    • 2016-01-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多