首页 文章

单击功能区按钮Word for mac时,不会更新任务窗格

提问于
浏览
1

我在功能区中开发了一个带有许多按钮的示例Word加载项 . 单击第一个按钮,HTML页面将显示在任务窗格中 . 在单击任何其他按钮时,任务窗格的内容将更新(正在呈现另一个HTML页面) .

该加载项适用于旧版本的2016 for Mac版,直到我将其更新为16.9更新后,单击任何其他功能区按钮不再更新任务窗格中的页面 .

我是否需要在清单中进行任何更改以确保加载项在最新版本的2016 for Mac中正常运行?

这是完整的清单文件

<?xml version="1.0" encoding="utf-8"?>
<!--Published:70EDFC97-B41D-43C5-B751-7C00AD999804-->
<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">

  <!-- See https://github.com/OfficeDev/Office-Add-in-Commands-Samples for documentation-->

  <!-- BeginBasicSettings: Add-in metadata, used for all versions of Office unless override provided -->

  <!--IMPORTANT! Id must be unique for your add-in. If you clone this manifest ensure that you change this id to your own GUID -->
  <Id>13a38f35-6020-4f66-b4af-54801e25c68d</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>ProNet</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <!-- The display name of your add-in. Used on the store and various placed of the Office UI such as the add-ins dialog -->
  <DisplayName DefaultValue="RealDocs" />
  <Description DefaultValue="Click the ProNet button to get started" />
  <!--Icon for your add-in. Used on installation screens and the add-ins dialog -->
  <IconUrl DefaultValue="https://realdocs.pronetcre.com/Images/ProNet_logo.png" />

  <!--BeginTaskpaneMode integration. Office 2013 and any client that doesn't understand commands will use this section.
    This section will also be used if there are no VersionOverrides -->
  <Hosts>
    <Host Name="Document" />
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://realdocs.pronetcre.com/OpenLanguageLibraries.html" />
  </DefaultSettings>
  <!--EndTaskpaneMode integration -->

  <Permissions>ReadWriteDocument</Permissions>

  <!--BeginAddinCommandsMode integration-->
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <!--Each host can have a different set of commands. Cool huh!? -->
      <!-- Workbook=Excel Document=Word Presentation=PowerPoint -->
      <!-- Make sure the hosts you override match the hosts declared in the top section of the manifest -->
      <Host xsi:type="Document">
        <!-- Form factor. Currenly only DesktopFormFactor is supported. We will add TabletFormFactor and PhoneFormFactor in the future-->
        <DesktopFormFactor>

          <!--GetStarted information used on the callout that appears when installing the add-in. 
            Ensure you have build 16.0.6769 or above for GetStarted section to work-->
          <GetStarted>
            <!--Title of the Getting Started callout. resid points to a ShortString resource -->
            <Title resid="Contoso.GetStarted.Title" />

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

            <!--Not used right now but you need to provide a valid resource. We will add code in the future to consume this URL. 
                            resid points to a Url resource -->
            <LearnMoreUrl resid="Contoso.GetStarted.LearnMoreUrl" />
          </GetStarted>

          <!--Function file is an html page that includes the javascript where functions for ExecuteAction will be called. 
            Think of the FunctionFile as the "code behind" ExecuteFunction-->
          <FunctionFile resid="Contoso.FunctionFile.Url" />

          <!--PrimaryCommandSurface==Main Office Ribbon-->
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <!--Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab -->
            <!-- Documentation includes all the IDs currently tested to work -->
            <CustomTab id="Contoso.Tab1">
              <!--Group ID-->
              <Group id="Contoso.Tab1.Group1">
                <!--Label for your group. resid must point to a ShortString resource -->
                <Label resid="Contoso.Tab1.Group1Label" />
                <Icon>
                  <!-- Sample Todo: Each size needs its own icon resource or it will look distorted when resized -->
                  <!--Icons. Required sizes 16,31,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX -->
                  <!--Use PNG icons and remember that all URLs on the resources section must use HTTPS -->
                  <bt:Image size="16" resid="Contoso.tpicon1_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon1_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon1_80x80" />
                </Icon>

                <!--Control. It can be of type "Button" or "Menu" -->
                <Control xsi:type="Button" id="Contoso.TaskpaneButton1">
                  <Label resid="Contoso.TaskpaneButton1.Label" />
                  <Supertip>
                    <Title resid="Contoso.TaskpaneButton1.Label" />
                    <Description resid="Contoso.TaskpaneButton1.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon1_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon1_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon1_80x80" />
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>MainTaskPane</TaskpaneId>
                    <!--Provide a url resource id for the location that will be displayed on the task pane -->
                    <SourceLocation resid="Contoso.Taskpane1.Url" />
                  </Action>
                </Control>




              </Group>
              <Group id="Contoso.Tab1.Group2">
                <!--Label for your group. resid must point to a ShortString resource -->
                <Label resid="Contoso.Tab1.Group2Label" />
                <Icon>
                  <!-- Sample Todo: Each size needs its own icon resource or it will look distorted when resized -->
                  <!--Icons. Required sizes 16,31,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX -->
                  <!--Use PNG icons and remember that all URLs on the resources section must use HTTPS -->
                  <bt:Image size="16" resid="Contoso.tpicon2_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon2_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon2_80x80" />
                </Icon>


                <Control xsi:type="Button" id="Contoso.TaskpaneButton2">
                  <!--Label for your button. resid must point to a ShortString resource -->
                  <Label resid="Contoso.TaskpaneButton2.Label" />
                  <Supertip>
                    <!--ToolTip title. resid must point to a ShortString resource -->
                    <Title resid="Contoso.TaskpaneButton2.Label" />
                    <!--ToolTip description. resid must point to a LongString resource -->
                    <Description resid="Contoso.TaskpaneButton2.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon2_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon2_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon2_80x80" />
                  </Icon>
                  <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
                  <!--Look at the FunctionFile.html page for reference on how to implement the function -->
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>MainTaskPane</TaskpaneId>
                    <!--Provide a url resource id for the location that will be displayed on the task pane -->
                    <SourceLocation resid="Contoso.Taskpane2.Url" />
                  </Action>
                </Control>
                <Control xsi:type="Button" id="Contoso.TaskpaneButton3">
                  <!--Label for your button. resid must point to a ShortString resource -->
                  <Label resid="Contoso.TaskpaneButton3.Label" />
                  <Supertip>
                    <!--ToolTip title. resid must point to a ShortString resource -->
                    <Title resid="Contoso.TaskpaneButton3.Label" />
                    <!--ToolTip description. resid must point to a LongString resource -->
                    <Description resid="Contoso.TaskpaneButton2.Tooltip" />
                  </Supertip>
                  <Icon>
                   <bt:Image size="16" resid="Contoso.tpicon3_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon3_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon3_80x80" />
                  </Icon>
                  <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
                  <!--Look at the FunctionFile.html page for reference on how to implement the function -->
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>MainTaskPane</TaskpaneId>
                    <!--Provide a url resource id for the location that will be displayed on the task pane -->
                    <SourceLocation resid="Contoso.Taskpane3.Url" />
                  </Action>
                </Control>
                <Control xsi:type="Button" id="Contoso.TaskpaneButton4">
                  <!--Label for your button. resid must point to a ShortString resource -->
                  <Label resid="Contoso.TaskpaneButton4.Label" />
                  <Supertip>
                    <!--ToolTip title. resid must point to a ShortString resource -->
                    <Title resid="Contoso.TaskpaneButton4.Label" />
                    <!--ToolTip description. resid must point to a LongString resource -->
                    <Description resid="Contoso.TaskpaneButton4.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon4_16x16" />
                  <bt:Image size="32" resid="Contoso.tpicon4_32x32" />
                  <bt:Image size="80" resid="Contoso.tpicon4_80x80" />
                  </Icon>
                  <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
                  <!--Look at the FunctionFile.html page for reference on how to implement the function -->
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>MainTaskPane</TaskpaneId>
                    <!--Provide a url resource id for the location that will be displayed on the task pane -->
                    <SourceLocation resid="Contoso.Taskpane4.Url" />
                  </Action>
                </Control>

              </Group>
              <Group id="Contoso.Tab1.Group3">
                <!--Label for your group. resid must point to a ShortString resource -->
                <Label resid="Contoso.Tab1.Group3Label" />
                <Icon>
                  <!-- Sample Todo: Each size needs its own icon resource or it will look distorted when resized -->
                  <!--Icons. Required sizes 16,31,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX -->
                  <!--Use PNG icons and remember that all URLs on the resources section must use HTTPS -->
                   <bt:Image size="16" resid="Contoso.tpicon5_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon5_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon5_80x80" />
                </Icon>

                <Control xsi:type="Button" id="Contoso.TaskpaneButton5">
                  <!--Label for your button. resid must point to a ShortString resource -->
                  <Label resid="Contoso.TaskpaneButton5.Label" />
                  <Supertip>
                    <!--ToolTip title. resid must point to a ShortString resource -->
                    <Title resid="Contoso.TaskpaneButton5.Label" />
                    <!--ToolTip description. resid must point to a LongString resource -->
                    <Description resid="Contoso.TaskpaneButton5.Tooltip" />
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Contoso.tpicon5_16x16" />
                    <bt:Image size="32" resid="Contoso.tpicon5_32x32" />
                    <bt:Image size="80" resid="Contoso.tpicon5_80x80" />
                  </Icon>
                  <!--This is what happens when the command is triggered (E.g. click on the Ribbon). Supported actions are ExecuteFuncion or ShowTaskpane-->
                  <!--Look at the FunctionFile.html page for reference on how to implement the function -->
                    <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>MainTaskPane</TaskpaneId>
                    <!--Provide a url resource id for the location that will be displayed on the task pane -->
                    <SourceLocation resid="Contoso.Taskpane5.Url" />
                  </Action>
                </Control>

              </Group>



              <!-- Label of your tab -->
              <!-- If validating with XSD it needs to be at the end, we might change this before release -->
              <Label resid="Contoso.Tab1.TabLabel" />
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Contoso.tpicon1_16x16" DefaultValue="https://realdocs.pronetcre.com/Images/ProNet_logo16x16.png" />
        <bt:Image id="Contoso.tpicon1_32x32" DefaultValue="https://realdocs.pronetcre.com/Images/ProNet_logo32x32.png" />
        <bt:Image id="Contoso.tpicon1_80x80" DefaultValue="https://realdocs.pronetcre.com/Images/ProNet_logo80x80.png" />
        <bt:Image id="Contoso.tpicon2_16x16" DefaultValue="https://realdocs.pronetcre.com/Images/MyAgreements16x16.png" />
        <bt:Image id="Contoso.tpicon2_32x32" DefaultValue="https://realdocs.pronetcre.com/Images//MyAgreements32x32.png" />
        <bt:Image id="Contoso.tpicon2_80x80" DefaultValue="https://realdocs.pronetcre.com/Images//MyAgreements80x80.png" />
        <bt:Image id="Contoso.tpicon3_16x16" DefaultValue="https://realdocs.pronetcre.com/Images/CompanyAgreements16x16.png" />
        <bt:Image id="Contoso.tpicon3_32x32" DefaultValue="https://realdocs.pronetcre.com/Images/CompanyAgreements32x32.png" />
        <bt:Image id="Contoso.tpicon3_80x80" DefaultValue="https://realdocs.pronetcre.com/Images/CompanyAgreements80x80.png" />
        <bt:Image id="Contoso.tpicon4_16x16" DefaultValue="https://realdocs.pronetcre.com/Images/RealDocs16x16.png" />
        <bt:Image id="Contoso.tpicon4_32x32" DefaultValue="https://realdocs.pronetcre.com/Images/RealDocs32x32.png" />
        <bt:Image id="Contoso.tpicon4_80x80" DefaultValue="https://realdocs.pronetcre.com/Images/RealDocs80x80.png" />
        <bt:Image id="Contoso.tpicon5_16x16" DefaultValue="https://realdocs.pronetcre.com/Images/SwitchAccount16x16.png" />
        <bt:Image id="Contoso.tpicon5_32x32" DefaultValue="https://realdocs.pronetcre.com/Images/SwitchAccount32x32.png" />
        <bt:Image id="Contoso.tpicon5_80x80" DefaultValue="https://realdocs.pronetcre.com/Images/SwitchAccount80x80.png" />
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Contoso.FunctionFile.Url" DefaultValue="https://realdocs.pronetcre.com/SwitchAccountFunction.html" />
      <bt:Url id="Contoso.Taskpane1.Url" DefaultValue="https://realdocs.pronetcre.com/OpenLanguageLibraries.html?Dialog=1" />
        <bt:Url id="Contoso.Taskpane2.Url" DefaultValue="https://realdocs.pronetcre.com/OpenLanguageLibraries.html?Dialog=2" />
        <bt:Url id="Contoso.Taskpane3.Url" DefaultValue="https://realdocs.pronetcre.com/OpenLanguageLibraries.html?Dialog=3" />
        <bt:Url id="Contoso.Taskpane4.Url" DefaultValue="https://realdocs.pronetcre.com/OpenLanguageLibraries.html?Dialog=4" />
        <bt:Url id="Contoso.Taskpane5.Url" DefaultValue="https://realdocs.pronetcre.com/OpenLanguageLibraries.html?Dialog=5" />

        <!--LearnMore URL currently not used -->
        <bt:Url id="Contoso.GetStarted.LearnMoreUrl" DefaultValue="https://commandsimple.azurewebsites.net/GetStarted.html">
        </bt:Url>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Contoso.Tab1.TabLabel" DefaultValue="ProNet" />
        <bt:String id="Contoso.Tab1.Group1Label" DefaultValue="Language Bar" />

         <bt:String id="Contoso.Tab1.Group2Label" DefaultValue="Documents" />
         <bt:String id="Contoso.Tab1.Group3Label" DefaultValue="Group" />
        <bt:String id="Contoso.TaskpaneButton1.Label" DefaultValue="Open Language Libraries" />


        <bt:String id="Contoso.TaskpaneButton2.Label" DefaultValue="My Agreements" />
         <bt:String id="Contoso.TaskpaneButton3.Label" DefaultValue="Company Agreements" />
        <bt:String id="Contoso.TaskpaneButton4.Label" DefaultValue="RealDocs by ProNet" />
        <bt:String id="Contoso.TaskpaneButton5.Label" DefaultValue="Switch Account" />

      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="Contoso.TaskpaneButton1.Tooltip" DefaultValue="Click to open language library" />

        <bt:String id="Contoso.TaskpaneButton2.Tooltip" DefaultValue="Click to open My Agreements" />
         <bt:String id="Contoso.TaskpaneButton3.Tooltip" DefaultValue="Click to open Company Agreements" />
        <bt:String id="Contoso.TaskpaneButton4.Tooltip" DefaultValue="Click to open RealDocs by ProNet" />
        <bt:String id="Contoso.TaskpaneButton5.Tooltip" DefaultValue="Click to Switch Account" />
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>

1 回答

  • 1

    由于您发布的XML不包含 Contoso.Taskpane2.UrlContoso.Taskpane3.UrlContoso.Taskpane4.Url 的值,我可以't answer with certainty -- but based on the scenario you'已经描述并且当您升级到16.9时观察到此行为更改,我怀疑您的问题可能与描述的问题有关这里:https://github.com/OfficeDev/office-js/issues/59 . 那是:

    有一个变化导致Mac对应用程序域格式更加严格,iOS也在一段时间内使用相同的验证 . 如果您删除应用领域中的最后一个“/”字符,则导航应该有效 .

    虽然这个问题是专门针对 AppDomain URL记录的,但它似乎也适用于其他网址(虽然我不完全确定) . 您的按钮网址是否恰好以 / 结尾?如果是这样,我建议您尝试从每个网址的末尾删除 / 以查看是否可以解决您的问题 .

相关问题