2

我正在关注此链接以尝试自定义功能。以下清单确实启用了自定义功能:

<?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>a124c024-2ae8-4d1a-bb00-7ff68c6fb738</Id>
  <!-- Generate a new guid for your Id element -->
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="Custom functions sample" />
  <Description DefaultValue="A variety of sample custom functions." />
  <Hosts>
    <Host Name="Workbook" />
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://www.myweb.com/customfunctions.html"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">
        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="functionsjs" />
            </Script>
            <Page>
              <SourceLocation resid="functionshtml"/>
            </Page>
          </ExtensionPoint>
        </AllFormFactors>
      </Host>
    </Hosts>
    <Resources>
      <bt:Urls>
        <bt:Url id="functionsjs" DefaultValue="https://www.myweb.com/customfunctions.js" />
        <bt:Url id="functionshtml" DefaultValue="https://www.myweb.com/customfunctions.html" />
      </bt:Urls>
    </Resources>
  </VersionOverrides>
</OfficeApp>

现在,我想知道是否可以同时拥有自定义功能和任务窗格。所以我<body>this is the body</body>https://www.myweb.com/customfunctions.html. 但是,重新加载加载项不会显示任务窗格。

谁能告诉我是否可以同时拥有自定义功能和任务窗格?我应该修改什么来启用它?

编辑 1:更改xsi:type="VersionOverridesV1_0"xsi:type="TaskPaneApp"确实会打开任务窗格,但是当我们尝试自定义功能时,会出现错误“我们无法启动此加载项,因为它没有正确设置”。

所以我仍在寻找合适的解决方案。

4

1 回答 1

1

是的,您可以使用插件命令在同一个插件中同时拥有自定义功能和任务窗格。

要启用任务窗格命令,请使用ShowTaskpane清单中的操作(请参阅帮助主题,如GitHub 上的此示例清单)。

如果您还希望您的任务窗格在插入时保持“永久”状态,请使用此主题页面自动打开任务窗格。

-Michael(自定义功能的 PM)

于 2018-01-02T21:43:12.670 回答