首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Officejs Excel加载项无法在excel桌面中看到功能区按钮

Officejs Excel加载项无法在excel桌面中看到功能区按钮
EN

Stack Overflow用户
提问于 2019-10-16 23:52:30
回答 1查看 64关注 0票数 0

我正在使用office.js为Excel创建office外接程序,我有如下清单文件,它不显示office add-in to insert in add in inserstion对话框,在excel on onpremise的共享文件夹选项卡中,但如果我更改版本覆盖以包含Schema1.1,它会显示选项以包括add in,但在excel中插入add in后,它不显示功能区。在Excel Online中一切运行正常,有任何建议请

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<!--Created:fsdfsdf-->
<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">

  <!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->

  <!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
  <Id>someid</Id>

  <!--Version. Updates from the store only get triggered if there is a version change. -->
  <Version>1.0.0.0</Version>
  <ProviderName>[Provider name]</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
  <DisplayName DefaultValue="Historian Addin" />
  <Description DefaultValue="ExcelWebAddIn1"/>
  <!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
  <IconUrl DefaultValue="~remoteAppUrl/Images/Button32x32.png" />

  <SupportUrl DefaultValue="http://www.aveva.com" />
  <!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
  <AppDomains>
    <AppDomain>AppDomain1</AppDomain>
    <AppDomain>AppDomain2</AppDomain>
    <AppDomain>AppDomain3</AppDomain>
  </AppDomains>
  <!--End Basic Settings. -->

  <!--Begin TaskPane Mode integration. This section is used if there are no VersionOverrides or if the Office client version does not support add-in commands. -->
  <Hosts>
    <Host Name="Workbook" />
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="http://localhost:32569/ExcelAddIn/index.html" />
  </DefaultSettings>
  <!-- End TaskPane Mode integration.  -->

  <Permissions>ReadWriteDocument</Permissions>

  <!-- Begin Add-in Commands Mode integration. -->
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">

    <!-- The Hosts node is required. -->
    <Hosts>
      <!-- Each host can have a different set of commands. -->
      <!-- Excel host is Workbook, Word host is Document, and PowerPoint host is Presentation. -->
      <!-- Make sure the hosts you override match the hosts declared in the top section of the manifest. -->
      <Host xsi:type="Workbook">
        <!-- Form factor. Currently only DesktopFormFactor is supported. -->
        <DesktopFormFactor>
          <!--"This code enables a customizable message to be displayed when the add-in is loaded successfully upon individual install."-->
          <GetStarted>
            <!-- Title of the Getting Started callout. The resid attribute points to a ShortString resource -->
            <Title resid="Wonderware.GetStarted.Title"/>

            <!-- Description of the Getting Started callout. resid points to a LongString resource -->
            <Description resid="Wonderware.GetStarted.Description"/>

            <!-- Points to a URL resource which details how the add-in should be used. -->
            <LearnMoreUrl resid="Wonderware.GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <!-- Function file is a HTML page that includes the JavaScript where functions for ExecuteAction will be called.
            Think of the FunctionFile as the code behind ExecuteFunction. -->
          <FunctionFile resid="Wonderware.DesktopFunctionFile.Url" />

          <!-- PrimaryCommandSurface is the main Office Ribbon. -->
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <!-- Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab. -->
            <OfficeTab id="TabHome">
              <!-- Ensure you provide a unique id for the group. Recommendation for any IDs is to namespace using your company name. -->
              <Group id="Wonderware.Group1">
                <!-- Label for your group. resid must point to a ShortString resource. -->
                <Label resid="Wonderware.Group1Label" />
                <!-- Icons. Required sizes 16,32,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX. -->
                <!-- Use PNG icons. All URLs on the resources section must use HTTPS. -->
                <Icon>
                  <bt:Image size="16" resid="Wonderware.tpicon_16x16" />
                  <bt:Image size="32" resid="Wonderware.tpicon_32x32" />
                  <bt:Image size="80" resid="Wonderware.tpicon_80x80" />
                </Icon>

                <!-- Control. It can be of type "Button" or "Menu". -->
                <Control xsi:type="Button" id="Wonderware.TaskpaneButton">
                  <Label resid="Wonderware.TaskpaneButton.Label" />
                  <Supertip>
                    <!-- ToolTip title. resid must point to a ShortString resource. -->
                    <Title resid="Wonderware.TaskpaneButton.Label" />
                    <!-- ToolTip description. resid must point to a LongString resource. -->
                    <Description resid="Wonderware.TaskpaneButton.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Wonderware.tpicon_16x16" />
                    <bt:Image size="32" resid="Wonderware.tpicon_32x32" />
                    <bt:Image size="80" resid="Wonderware.tpicon_80x80" />
                  </Icon>

                  <!-- This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFunction or ShowTaskpane. -->
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <!-- Provide a URL resource id for the location that will be displayed on the task pane. -->
                    <SourceLocation resid="Wonderware.Taskpane.Url" />
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <!-- You can use resources across hosts and form factors. -->
    <Resources>
      <bt:Images>
        <bt:Image id="Wonderware.tpicon_16x16" DefaultValue="http://localhost:32569/ExcelAddIn/assets/Images/addin-16x16.png" />
        <bt:Image id="Wonderware.tpicon_32x32" DefaultValue="http://localhost:32569/ExcelAddIn/assets/Images/addin-32x32.png" />
        <bt:Image id="Wonderware.tpicon_80x80" DefaultValue="http://localhost:32569/ExcelAddIn/assets/Images/addin-80x80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Wonderware.DesktopFunctionFile.Url" DefaultValue="~remoteAppUrl/Functions/FunctionFile.html" />
        <bt:Url id="Wonderware.Taskpane.Url" DefaultValue="http://localhost:32569/ExcelAddIn/index.html" />
        <bt:Url id="Wonderware.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
      </bt:Urls>
      <!-- ShortStrings max characters==125. -->
      <bt:ShortStrings>
        <bt:String id="Wonderware.TaskpaneButton.Label" DefaultValue="Historian" />
        <bt:String id="Wonderware.Group1Label" DefaultValue="Historian" />
        <bt:String id="Wonderware.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
      </bt:ShortStrings>
      <!-- LongStrings max characters==250. -->
      <bt:LongStrings>
        <bt:String id="Wonderware.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
        <bt:String id="Wonderware.GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
  <!-- End Add-in Commands Mode integration. -->

</OfficeApp>

Office excel内部版本号和版本为

如果我将VersionOverrides更改为1.1模式,它会加载,但随后不会显示功能区,它在excel online中运行良好。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-22 02:15:20

问题是清单文件中使用的ids超过30个字符,请确保ids小于30个字符。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58417284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档