Office加载项:“自定义”选项卡不会在桌面PP / Excel中显示,在365中可以正常工作

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

我的清单在Office 365(Word,Powerpoint,Excel)和台式机上的Word中进行测试时工作正常。在桌面上的Powerpoint或Excel中运行同一清单时,自定义选项卡根本不会显示在功能区中。它在底部显示“加载项已成功加载”,但功能区中未显示任何选项卡。

这里是清单xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
  <Id>130f75aa-a500-458a-bc48-031e57b7d70e</Id>
  <Version>1.1.0.0</Version>
  <ProviderName>MyCompany AB</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="MyCompany Test"/>
  <Description DefaultValue="Sign agreements online with MyCompany"/>
  <IconUrl DefaultValue="https://testbed-office-addin.scrive.com/public/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://testbed-office-addin.scrive.com/public/assets/icon-80.png"/>
  <SupportUrl DefaultValue="https://support.scrive.com/"/>
  <AppDomains>
    <AppDomain>scrive.com</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Workbook"/>
    <Host Name="Document"/>
    <Host Name="Presentation"/>
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://testbed-office-addin.scrive.com/public"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Description resid="Version.Description" />
    <Hosts>
      <Host xsi:type="Workbook">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="MyCompanyTab">
              <Group id="MyCompanyCommands">
                <Label resid="CommandsGroup.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="MyCompanyTaskpaneButton">
                  <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">
                    <SourceLocation resid="Taskpane.Url"/>
                    <Title resid="TaskpaneButton.Label"/>
                  </Action>
                </Control>
              </Group>
              <Label resid="CustomTab.Label"/>
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="MyCompanyTab">
              <Group id="MyCompanyCommands">
                <Label resid="CommandsGroup.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="MyCompanyTaskpaneButton">
                  <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">
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>
              <Label resid="CustomTab.Label"/>
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
      <Host xsi:type="Presentation">
        <DesktopFormFactor>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="MyCompanyTab">
              <Group id="MyCompanyCommands">
                <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="MyCompanyTaskpaneButton">
                  <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">
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
                <Label resid="CommandsGroup.Label"/>
              </Group>
              <Label resid="CustomTab.Label"/>
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://testbed-office-addin.scrive.com/public/assets/icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://testbed-office-addin.scrive.com/public/assets/icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://testbed-office-addin.scrive.com/public/assets/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://www.scrive.com/products/"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://testbed-office-addin.scrive.com/public/index.html"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Version.Description" DefaultValue="Sign agreements online with MyCompany"/>
        <bt:String id="GetStarted.Title" DefaultValue="Get started with MyCompany Test!"/>
        <bt:String id="CommandsGroup.Label" DefaultValue="MyCompany"/>
        <bt:String id="CustomTab.Label" DefaultValue="MyCompany Test"/>
        <bt:String id="TaskpaneButton.Label" DefaultValue="MyCompany Test"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="MyCompany Test loaded successfully. Go to the MyCompany Test tab and click the 'MyCompany Test' button to get started."/>
        <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to show MyCompany Test configuration"/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
office-addins office-store
1个回答
0
投票

为了帮助其他为此奋斗的人,我将把我的发现最终发布到工作清单文件中。

  1. Action ShowTaskpane需要具有<TaskpaneId>元素
    <Action xsi:type="ShowTaskpane">
      <TaskpaneId>ButtonId1</TaskpaneId>
      <SourceLocation resid="Taskpane.Url"/>
    </Action>
  1. office-addin-debugging工具有时会在以下位置缓存清单文件(OSX):
    • / Users // Library / Containers / com.microsoft.Word / Data / Documents / wef
    • / Users // Library / Containers / com.microsoft.Excel / Data / Documents / wef
    • / Users // Library / Containers / com.microsoft.Powerpoint / Data / Documents / wef

这可能会导致在使用调试工具进行测试时无法反映本地所做的更改。在每轮测试之后,我开始删除缓存的文件后,我很快发现了什么在起作用,什么没在起作用。

© www.soinside.com 2019 - 2024. All rights reserved.