0

我知道您可以使用 VSTO 和 COMM 插件构建完整的功能区。您是否能够使用 MS Word 2016 的新 office-js 构建这些?

我找不到任何办法这样做。或者,我想知道我们是否可以构建一个 VSTO 插件功能区来打开我们的 office-js 插件?

我们只希望功能区看起来不错,而不是在插入 -> 我的加载项 -> 中,如下所示:

在此处输入图像描述

以下是我按照https://docs.microsoft.com/en-us/office/dev/add-ins/design/contextual-tabs上的说明获得的内容:

<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>260eddsdd5</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue=" Local"/>
  <Description DefaultValue=" Add-in"/>
  <IconUrl DefaultValue="https://localhost/dw/assets/icon-80.png"> </IconUrl>
  <HighResolutionIconUrl DefaultValue="https://localhost/dw/assets/icon-80.png"/>
  <SupportUrl DefaultValue="https://help"/>
  <AppDomains>
    <AppDomain>localhost/dw</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Document"/>
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://localhost/dw/taskpane.html"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Document">
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title"/>
            <Description resid="GetStarted.Description"/>
            <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <FunctionFile resid="Commands.Url"/>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="TabCustom1">
              <Group id="myCustomTab.grp1">
                <Label resid="residCustomTabGroupLabel"/>
                <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="TaskpaneButton">
                  <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">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
                <OfficeControl id="Superscript" />
              </Group>
              <OfficeGroup id="Paragraph" />
              <Label resid="customTabLabel1" />
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https:///icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
        <bt:Url id="Commands.Url" DefaultValue="https://localhost/dw/commands.html"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://localhost/dw/taskpane.html"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="GetStarted.Title" DefaultValue="Get started !"/>
        <bt:String id="CommandsGroup.Label" DefaultValue="Click"/>
        <bt:String id="TaskpaneButton.Label" DefaultValue="Click"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue=" add-in loaded succesfully. Go to the HOME tab and click the button to get started."/>
        <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane"/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
4

1 回答 1

0

是的。您可以使用 Office Web 加载项自定义功能区。功能区上的自定义按钮和菜单称为加载项命令,您可以在加载项的清单中配置它们。有关详细信息,请从加载项命令创建加载项命令开始。

于 2021-02-02T21:40:25.637 回答