【问题标题】:Office API Javascript - Loading error telemetryproxy.html not foundOffice API Javascript - 未找到加载错误 telemetryproxy.html
【发布时间】:2018-03-25 12:25:10
【问题描述】:

我尝试将 Office.js 加载到我的应用程序中。

我添加了<script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"></script>

我在控制台中收到警告和错误。

Warning: Office.js is loaded outside of Office client

和错误:o15apptofilemappingtable.js:11 GET https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html 404 (Not Found)

我创建的 app.js 包含:

Office.initialize = function (reason) {
$(document).ready(function () {
    switch (reason) {
        case 'inserted': console.log('The add-in was just inserted.');
        case 'documentOpened': console.log('The add-in is already part of 
              the document.');
    }
  });
};

有人可以帮助我,请问我该如何解决?

谢谢!

【问题讨论】:

    标签: javascript ms-word office-js


    【解决方案1】:

    当您尝试在浏览器页面中打开加载项时,预计会出现第一个错误。 Office.js 只能在 Office 应用程序中工作,例如在任务窗格中。要运行您正在开发的加载项,您需要将其旁加载到 Office 应用程序中。如果您使用的是 Visual Studio,则只需按 F5。如果您使用不同的编辑器,则需要使用其中一种侧载技术。详情请见Sideload Office Add-ins for testing

    第二个错误可能是第一个错误的副作用。

    【讨论】:

    • 好的,谢谢!
    猜你喜欢
    • 1970-01-01
    • 2015-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多