BernhardWebstudio
BernhardWebstudio

Reputation: 1135

Office Add-In requirements lead to loading failure

I can not set the requirements in the Manifest for my Word Plugin without either loosing the Add-in commands or the ability to run it.

My Manifest looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<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>id</Id>
  <Version>1.0.0.4</Version>
  <ProviderName>Bernhard Webstudio</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="foo" />
  <Description DefaultValue="bar"/>
  <IconUrl DefaultValue="~remoteAppUrl/Images/logo.png" />

  <SupportUrl DefaultValue="https://twitter.com/BernhardWStudio" />
  <AppDomains>
    <AppDomain>AppDomain1</AppDomain>
    <AppDomain>AppDomain2</AppDomain>
  </AppDomains>

<Hosts>
  <Host Name="Document" />
</Hosts>

<!-- when commenting the following lines out, it works -->
  <Requirements>
    <Sets DefaultMinVersion="1.3">
      <Set Name="TableBindings" />
      <Set Name="Selection" />
      <Set Name="AddinCommands" MinVersion="1.1" />
    </Sets>
  </Requirements>

  <DefaultSettings>
    <SourceLocation DefaultValue="~remoteAppUrl/Home.html" />
  </DefaultSettings>

  <Permissions>ReadWriteDocument</Permissions>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <!-- when I set the Requirements here (with bt: prefix for Sets & Set), I only see the taskpane but no ribbon buttons -->
    <Hosts>
       <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="BeWeStd.GetStarted.Title"/>
            <Description resid="BeWeStd.GetStarted.Description"/>
            <LearnMoreUrl resid="BeWeStd.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <FunctionFile resid="BeWeStd.DesktopFunctionFile.Url" />

          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <OfficeTab id="TabHome">
               <Group id="BeWeStd.Group1">
                <Label resid="BeWeStd.Group1Label" />
                <Icon>
                  <bt:Image size="16" resid="BeWeStd.tpicon_16x16" />
                  <bt:Image size="32" resid="BeWeStd.tpicon_32x32" />
                  <bt:Image size="32" resid="BeWeStd.tpicon_64x64" />
                  <bt:Image size="80" resid="BeWeStd.tpicon_80x80" />
                </Icon>
                <Control xsi:type="Button" id="BeWeStd.TaskpaneBtn.Info">
                  <Label resid="BeWeStd.TaskpaneBtn.Info.Label" />
                  <Supertip>
                    <Title resid="BeWeStd.TaskpaneBtn.Info.Label" />
                    <Description resid="BeWeStd.TaskpaneBtn.Info.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="BeWeStd.infoicon_16x16" />
                    <bt:Image size="32" resid="BeWeStd.infoicon_32x32" />
                    <bt:Image size="80" resid="BeWeStd.infoicon_80x80" />
                  </Icon>

                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <SourceLocation resid="BeWeStd.Taskpane.Url" />
                  </Action>
                </Control>
                <!-- more Control elements removed to reduce Code -->
                </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <!-- resources not listed to reduce amount of Code -->
    </Resources>
  </VersionOverrides>
</OfficeApp>

I tried to set them in various places (see comments in Code). Unfortunately, it does not help. Either the Add-in crashes (without log) or does not display the ribbon bar items. I need to set the requirements as my features rely on API 1.3 and does not work in elder versions, so the Add-in does not get approved without it.

The above placement of <Requirements> is inspired by the docs. If I place it one element further up or down, the xml-validation fails. But where it is now, the validation tells me it should work.

Where do I have to place <Requirements> without breaking the Add-in?

Upvotes: 1

Views: 55

Answers (1)

Marc LaFleur
Marc LaFleur

Reputation: 33124

The trouble here is that DefaultMinVersion="1.3" sets the default version for child elements. In turn, this means you're requiring a minimum version of 1.3 for TableBindings and Selection. The latest version of these two requirement sets is 1.1 so Word fails to load the add-in since it fails to meet your minimum version requirement.

What you need here is to specify WordApi with a minimum version of 1.3. Try using this instead:

<Requirements>
    <Sets DefaultMinVersion="1.1">
        <Set Name="TableBindings" />
        <Set Name="Selection" />
        <Set Name="AddinCommands" />
        <Set Name="WordApi" MinVersion="1.3" />
    </Sets>
</Requirements>

Upvotes: 1

Related Questions