带有 Office 2013 功能区按钮的 Office 插件清单

Office Addin Manifest With a Ribbon Button for Office 2013

我构建了一个 Word 加载项清单,用于在“主页”选项卡中插入一个按钮。按钮打开任务窗格,插件不使用命令,因此不仅适用于Office 2016,也适用于Office 2013。

尽管该插件在两个 Office 版本上都能正常工作,但该按钮会插入到 Office 2016 的“主页”选项卡中,但在 2013 中却没有。

我怀疑清单中可能还有其他预期内容,即使我读到 VersionOverrides 节点足以支持这两个版本。

这是在 Word 2016 中显示没有问题的清单:

<?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>05c2e1c9-3e1d-406e-9a91-e9ac64854143</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>DEMO</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Name">
    <Override Locale="en-US" Value="Name" />
  </DisplayName>
  <Description DefaultValue="Addin" >
    <Override Locale="en-US" Value="Addin" />
  </Description>
  <IconUrl DefaultValue="https://localhost:3000/assets/logo-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/logo-80.png"/>
  <SupportUrl DefaultValue="support.com" />
  <AppDomains>
    <AppDomain>localhost</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Document"/>
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <ov:VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <ov:Hosts>
      <ov:Host xsi:type="Document">
        <ov:DesktopFormFactor>
          <ov:GetStarted>
            <ov:Title resid="GetStarted.Title"/>
            <ov:Description resid="GetStarted.Description"/>
            <ov:LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
          </ov:GetStarted>
          <ov:ExtensionPoint xsi:type="PrimaryCommandSurface">
            <ov:OfficeTab id="TabHome">
              <ov:Group id="AddinGroup">
                <ov:Label resid="CommandsGroup.Label" />
                <ov:Icon>
                  <bt:Image size="16" resid="Icon.16x16" />
                  <bt:Image size="32" resid="Icon.32x32" />
                  <bt:Image size="80" resid="Icon.80x80" />
                </ov:Icon>
                <ov:Control xsi:type="Button" id="AddinButton">
                  <ov:Label resid="AddinButton.Label" />
                  <ov:Supertip>
                    <ov:Title resid="AddinButton.Label" />
                    <ov:Description resid="AddinButton.Tooltip" />
                  </ov:Supertip>
                  <ov:Icon>
                    <bt:Image size="16" resid="Icon.16x16" />
                    <bt:Image size="32" resid="Icon.32x32" />
                    <bt:Image size="80" resid="Icon.80x80" />
                  </ov:Icon>
                  <ov:Action xsi:type="ShowTaskpane">
                    <ov:TaskpaneId>AddinButtonTaskpane</ov:TaskpaneId>
                    <ov:SourceLocation resid="AddinTaskpane.Url" />
                  </ov:Action>
                </ov:Control>
              </ov:Group>
            </ov:OfficeTab>
          </ov:ExtensionPoint>
        </ov:DesktopFormFactor>
      </ov:Host>
    </ov:Hosts>
    <ov:Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/logo-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/logo-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/logo-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="http://started.com" />
        <bt:Url id="AddinTaskpane.Url" DefaultValue="https://localhost:3000/taskpane.html" />
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GetStarted.Title" DefaultValue="GetStarted" >
        </bt:String>
        <bt:String id="CommandsGroup.Label" DefaultValue="Addin" >
        </bt:String>
        <bt:String id="AddinButton.Label" DefaultValue="Addin" >
        </bt:String>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="GetStarted" >
        </bt:String>
        <bt:String id="AddinButton.Tooltip" DefaultValue="Addin" >
        </bt:String>
      </bt:LongStrings>
    </ov:Resources>
  </ov:VersionOverrides>
</OfficeApp>

Word 2013 不支持加载项命令。有关加载项命令支持的平台的详细信息,请参阅here