Office js 使用ExpressJS配置Office JS word加载项而不使用Yeoman生成器

Office js 使用ExpressJS配置Office JS word加载项而不使用Yeoman生成器,office-js,word-addins,Office Js,Word Addins,错误:Office.js尚未完全加载。你的应用程序必须调用“Office.onReady()”,作为加载顺序的一部分(或设置“Office.initialize”函数)。如果您的应用程序具有此功能,请尝试重新加载此页面。我在尝试从清单文件加载html页面时看到此错误 HTML content is <!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. -

错误:Office.js尚未完全加载。你的应用程序必须调用“Office.onReady()”,作为加载顺序的一部分(或设置“Office.initialize”函数)。如果您的应用程序具有此功能,请尝试重新加载此页面。我在尝试从清单文件加载html页面时看到此错误

HTML content is 
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. -->
<!-- This file shows how to design a first-run page that provides a welcome screen to the user about the features of the add-in. -->

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Contoso Task Pane Add-in</title>

    <!-- Office JavaScript API  -->
    <script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" </script>
 
    <!-- For more information on Office UI Fabric, visit https://developer.microsoft.com/fabric. -->
    <link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/9.6.1/css/fabric.min.css"/>

    <!-- Template styles -->
    <link href="taskpane.css" rel="stylesheet" type="text/css" />
</head>

<body class="ms-font-m ms-welcome ms-Fabric">
    <header class="ms-welcome__header ms-bgColor-neutralLighter">
        <img width="90" height="90" src="../../logo-filled.png" alt="Contoso" title="Contoso" />
        <h1 class="ms-font-su">Welcome</h1>
    </header>
 <!--   <section id="sideload-msg" class="ms-welcome__main">
        <h2 class="ms-font-xl">Please sideload your add-in to see app body.</h2>
    </section> -->
     <main id="app-body" class="ms-welcome__main">
    <h2 class="ms-font-xl"> Discover what Office Add-ins can do for you today! </h2>
    <p><label id="item-subject"></label></p>
    <div role="button" id="run" class="ms-welcome__action ms-Button ms-Button--hero ms-font-xl">
        <span class="ms-Button-label">Run</span>
    </div>
</main>
</body>

</html>
HTML内容是
Contoso任务窗格加载项
{
if(info.host==Office.HostType.Outlook){
log(`Office.js现在在${info.platform}`上的${info.host}中准备就绪);
document.getElementById(“sideload msg”).style.display=“无”;
document.getElementById(“应用程序正文”).style.display=“flex”;
document.getElementById(“run”).onclick=run;
}
});
导出异步函数run(){
/**
*在此处插入Outlook代码
*/
//获取对当前消息的引用
var item=Office.context.mailbox.item;
//将消息属性值写入任务窗格
document.getElementById(“项目主题”).innerHTML=“主题:
”+item.subject; }
/*
 * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
 * See LICENSE in the project root for license information.
 */

// images references in the manifest
import "../../icon-16.png";
import "../../icon-32.png";
import "../../icon-80.png";

/* global document, Office */


Office.onReady(info => {
  if (info.host === Office.HostType.Outlook) {
    console.log(`Office.js is now ready in ${info.host} on ${info.platform}`);
    document.getElementById("sideload-msg").style.display = "none";
    document.getElementById("app-body").style.display = "flex";
    document.getElementById("run").onclick = run;
  }
});

export async function run() {
  /**
   * Insert your Outlook code here
   */
// Get a reference to the current message
var item = Office.context.mailbox.item;

// Write message property value to the task pane
document.getElementById("item-subject").innerHTML = "<b>Subject:</b> <br/>" + item.subject;
}