【问题标题】:Add-in Manifest.xml file Develop using Custom tab with Groups is not working on Desktop Excel 365 but works on Online Office 365加载项 Manifest.xml 文件“使用组的自定义选项卡开发”不适用于 Desktop Excel 365,但适用于 Online Office 365
【发布时间】:2020-05-05 12:54:32
【问题描述】:

我们为自定义选项卡开发了 Add-in Manifest.xml 文件和组。 我们参考下面的网址来开发它。 https://docs.microsoft.com/en-us/office/dev/add-ins/reference/manifest/customtab#customtab-example https://docs.microsoft.com/en-us/office/dev/add-ins/reference/manifest/group

开发 Manifest.xml 文件在 office Online 365 上工作正常,但是当我们在 Desktop Excel 365 上导入相同文件时,它就无法正常工作了。

            <!--Control. It can be of type "Button" or "Menu" -->
            <Control xsi:type="Button" id="Contoso.FunctionButton">
            <!--Label for your button. resid must point to a ShortString resource -->
              <Label resid="Contoso.FunctionButton.Label" />
              <Tooltip resid="Contoso.FunctionButton.Tooltip"/>
              <Supertip>
                 <!--ToolTip title. resid must point to a ShortString resource -->
                <Title resid="Contoso.FunctionButton.Label" />
                 <!--ToolTip description. resid must point to a LongString resource -->
                <Description resid="Contoso.FunctionButton.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Contoso.FunctionButton.Icon" />
                <bt:Image size="32" resid="Contoso.FunctionButton.Icon" />
                <bt:Image size="80" resid="Contoso.FunctionButton.Icon" />
              </Icon>
              <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
              <!--Look at the FunctionFile.html page for reference on how to implement the function -->
              <Action xsi:type="ShowTaskpane">
              <!--Name of the function to call. This function needs to exist in the global DOM namespace of the function file-->
              <TaskpaneId>ButtonId1</TaskpaneId>
                <SourceLocation resid="Contoso.FunctionButton.Url" />
              </Action>
            </Control>

            <Control xsi:type="Button" id="Contoso.TaskpaneButton">
              <Label resid="Contoso.TaskpaneButton.Label" />
              <Tooltip resid="Contoso.TaskpaneButton.Tooltip" />
              <Supertip>
                <Title resid="Contoso.TaskpaneButton.Label" />
                <Description resid="Contoso.TaskpaneButton.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Contoso.TaskpaneButton.Icon" />
                <bt:Image size="32" resid="Contoso.TaskpaneButton.Icon" />
                <bt:Image size="80" resid="Contoso.TaskpaneButton.Icon" />
              </Icon>
              <Action xsi:type="ShowTaskpane">
                <TaskpaneId>Button2Id1</TaskpaneId>
                 <!--Provide a url resource id for the location that will be displayed on the task pane -->
                <SourceLocation resid="Contoso.Taskpane1.Url" />
              </Action>
            </Control>
        <!-- Menu example -->


          </Group>
          <Group id="Contoso.Tab1.Group2">
             <!--Label for your group. resid must point to a ShortString resource -->
            <Label resid="Contoso.Tab1.GroupLabel" />
            <Icon>
            <!-- Sample Todo: Each size needs its own icon resource or it will look distorted when resized -->
            <!--Icons. Required sizes 16,31,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX -->
            <!--Use PNG icons and remember that all URLs on the resources section must use HTTPS -->
              <bt:Image size="16" resid="Contoso.TaskpaneButton.Icon" />
              <bt:Image size="32" resid="Contoso.TaskpaneButton.Icon" />
              <bt:Image size="80" resid="Contoso.TaskpaneButton.Icon" />
            </Icon>

            <!--Control. It can be of type "Button" or "Menu" -->
            <Control xsi:type="Button" id="Contoso.FunctionButton">
            <!--Label for your button. resid must point to a ShortString resource -->
              <Label resid="Contoso.FunctionButton.Label" />
              <Tooltip resid="Contoso.FunctionButton.Tooltip"/>
              <Supertip>
                 <!--ToolTip title. resid must point to a ShortString resource -->
                <Title resid="Contoso.FunctionButton.Label" />
                 <!--ToolTip description. resid must point to a LongString resource -->
                <Description resid="Contoso.FunctionButton.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Contoso.FunctionButton.Icon" />
                <bt:Image size="32" resid="Contoso.FunctionButton.Icon" />
                <bt:Image size="80" resid="Contoso.FunctionButton.Icon" />
              </Icon>
              <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
              <!--Look at the FunctionFile.html page for reference on how to implement the function -->
              <Action xsi:type="ShowTaskpane">
              <!--Name of the function to call. This function needs to exist in the global DOM namespace of the function file-->
              <TaskpaneId>ButtonId1</TaskpaneId>
                <SourceLocation resid="Contoso.FunctionButton.Url" />
              </Action>
            </Control>

            <Control xsi:type="Button" id="Contoso.TaskpaneButton">
              <Label resid="Contoso.TaskpaneButton.Label" />
              <Tooltip resid="Contoso.TaskpaneButton.Tooltip" />
              <Supertip>
                <Title resid="Contoso.TaskpaneButton.Label" />
                <Description resid="Contoso.TaskpaneButton.Tooltip" />
              </Supertip>
              <Icon>
                <bt:Image size="16" resid="Contoso.TaskpaneButton.Icon" />
                <bt:Image size="32" resid="Contoso.TaskpaneButton.Icon" />
                <bt:Image size="80" resid="Contoso.TaskpaneButton.Icon" />
              </Icon>
              <Action xsi:type="ShowTaskpane">
                <TaskpaneId>Button2Id1</TaskpaneId>
                 <!--Provide a url resource id for the location that will be displayed on the task pane -->
                <SourceLocation resid="Contoso.Taskpane1.Url" />
              </Action>
            </Control>
        <!-- Menu example -->


          </Group>

          <!-- Label of your tab -->
          <!-- If validating with XSD it needs to be at the end, we might change this before release -->
          <Label resid="Contoso.Tab1.TabLabel" />
        </CustomTab>
      </ExtensionPoint>

请帮助我们解决它。

【问题讨论】:

  • 请提供更多详细信息,而不仅仅是“不工作”。出了什么问题以及导致它的步骤是什么?
  • @Sameer,请提供更多信息以提出任何建议。如果您遇到与 Teams 有关的任何问题,请提及。
  • 当我们使用带有多个 标签的 标签时,在桌面上的插件中不会读取插件清单文件。

标签: office365 ms-office office-js microsoft-teams excel-addins


【解决方案1】:

基于:

我猜测有一个问题是您在 Office Online 的菜单中看到相应的项目,但在桌面版本中看不到它。如果是这样,您可以尝试以下步骤:

  • 去掉CustomTab的id属性中的空格:&lt;CustomTab id="ContosoTab"&gt;

此外,您还可以查看 ScriptLab 的清单。这是工作清单的一个很好的例子。 https://github.com/OfficeDev/script-lab/tree/master/manifests

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-05
    • 2023-01-10
    • 2015-02-26
    相关资源
    最近更新 更多