重试并启动后加载 Word 加载项时出错

Error Loading Word Add-in Eventually Works After Retry & Start

我的加载项在 Windows 上使用 Word 正常加载,但通过 Word Online(使用 Chrome、Firefox 和 Edge 测试)显示加载错误,即使单击提示按钮最终加载了加载项和一切都按预期工作。这是我在加载项中看到的,只是加载了一个使用页面 (https://office.flexxlegal.com/Home/Usage):

  1. 页面在任务窗格中加载,带有灰色叠加层和加载动画
  2. 收到加载项错误消息 - 出了点问题,我们无法启动此加载项。请稍后重试或联系您的系统管理员。
  3. 单击“重试”按钮
  4. 页面再次显示在任务窗格中,并带有叠加和加载动画
  5. 收到加载项错误消息 - 此加载项可能无法正确加载,但您仍然可以尝试启动它。
  6. 单击“开始”按钮
  7. 页面加载且一切正常

以下是与他的控件相关的应用程序清单部分:

<Control xsi:type="Button" id="Flexx.Help">
  <Label resid="Flexx.Help.Label" />
  <Supertip>
    <!-- ToolTip title. resid must point to a ShortString resource. -->
    <Title resid="Flexx.Help.Label" />
    <!-- ToolTip description. resid must point to a LongString resource. -->
    <Description resid="Flexx.Help.Tooltip" />
  </Supertip>
  <Icon>
    <bt:Image size="16" resid="Flexx.qicon_16x16" />
    <bt:Image size="32" resid="Flexx.qicon_32x32" />
    <bt:Image size="80" resid="Flexx.qicon_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>FLTaskPane</TaskpaneId>
    <!-- Provide a url resource id for the location that will be displayed on the task pane. -->
    <SourceLocation resid="Flexx.Help.Url" />
  </Action>
</Control>

<Resources>
  <bt:Images>
    <bt:Image id="Flexx.qicon_16x16" DefaultValue="https://office.flexxlegal.com/assets/img/Q16.png" />
    <bt:Image id="Flexx.qicon_32x32" DefaultValue="https://office.flexxlegal.com/assets/img/Q32.png" />
    <bt:Image id="Flexx.qicon_80x80" DefaultValue="https://office.flexxlegal.com/assets/img/Q80.png" />
  </bt:Images>
  <bt:Urls>
    <bt:Url id="Flexx.Help.Url" DefaultValue="https://office.flexxlegal.com/Home/Usage" />
  </bt:Urls>
  <!-- ShortStrings max characters==125. -->
  <bt:ShortStrings>
    <bt:String id="Flexx.Help.Label" DefaultValue="Getting Started" />
  </bt:ShortStrings>
  <!-- LongStrings max characters==250. -->
  <bt:LongStrings>
    <bt:String id="Flexx.Help.Tooltip" DefaultValue="Click to view usage information to get started with this FlexxLegal add-in." />
  </bt:LongStrings>
</Resources>

加载网页时没有代码隐藏,没有 javascript,只有静态 HTML 页面。是否了解问题可能是什么,或者我将如何确定问题?

谢谢, 瑞安

With the webpage being loaded there is no code-behind, no javascript, just a static HTML page

这是你的问题。您的 add-in 页面必须引用 office.js 库并包含 Office.initialize 处理程序。

我建议查看有关 Office Web Add-ins 工作原理的文档:Understanding the JavaScript API for Office