是否可以在Office.js中创建功能区选项卡?

问题描述 投票:0回答:1

我正在尝试为Windows Excel在OfficeJS中创建自己的选项卡。我使用Yeoman生成器创建了一个测试应用程序,并尝试将CustomTab和Label一起使用,但是功能区上没有任何显示。我不确定我是否正确理解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个回答
2
投票

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

    <CustomTab id="Tab.Home">

如果要创建新的功能区选项卡,则可以更改此行:

    <CustomTab id="NewRibbonTab.Tab1">
© www.soinside.com 2019 - 2024. All rights reserved.