office365 - 使用“自定义”选项卡和“组”进行开发的加载项 Manifest.xml 文件不适用于桌面 Excel 365,但适用于 Online Office 365

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

我们已经为带有组的自定义选项卡开发了Add-in Manifest.xml 文件。 我们引用下面的网址来开发它。 https://learn.microsoft.com/en-us/office/dev/add-ins/reference/manifest/customtab#customtab-example https://learn.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>

请帮助我们解决这个问题。

最佳答案

基于:

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

  • 删除CustomTab的id属性中的空格:<CustomTab id="ContosoTab">

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

关于office365 - 使用“自定义”选项卡和“组”进行开发的加载项 Manifest.xml 文件不适用于桌面 Excel 365,但适用于 Online Office 365,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61613666/

相关文章:

azure - 无法访问office365组中的日历

c# - 在 C# 中写入和读取 excel 文件

c# - 在c#中的任意起始索引上初始化数组

javascript - 使用javascript在word中的现有内容控件之后添加内容控件?

SharePoint Office365 - 如何复制列表?

Microsoft.com 上的 Office365 身份验证失败 : Application with identifier XXX was not found in the directory YYY.

powershell - 您可以将互操作程序集与 Office 365 客户端应用程序一起使用吗?

ms-office - O365 同意流程中的身份验证和权限错误

office-addins - 为 Office 应用商店提交加载项时,应在 list 文件中引用哪个版本的 Excel API?

javascript - Excel 2019 桌面上的 WorksheetCollection.onActivated 事件出现 "AccessDenied"错误