Office js 在Office.onReady()中如何访问Excel.RequestContext?

Office js 在Office.onReady()中如何访问Excel.RequestContext?,office-js,excel-addins,Office Js,Excel Addins,我想根据Excel文档的自定义属性控制Excel加载项(用TypeScript编写)UI的某些方面。为此,我需要在使用Office.onReady()方法时访问Excel.RequestContext。可能吗?如果没有,还有其他选择吗?你能把这两个电话连起来吗?即: 在TypeScript中: (async () => { await Office.onReady(); await Excel.run(async context => { <..

我想根据Excel文档的自定义属性控制Excel加载项(用TypeScript编写)UI的某些方面。为此,我需要在使用Office.onReady()方法时访问Excel.RequestContext。可能吗?如果没有,还有其他选择吗?

你能把这两个电话连起来吗?即:

在TypeScript中:

(async () => {
    await Office.onReady();
    await Excel.run(async context => {
        <...>
    });
})()
(异步()=>{
等待办公室;
等待Excel.run(异步上下文=>{
});
})()
或在JavaScript中:

Office.onReady().then(function() {
    return Excel.run(function(context) {
        <...>
    }); 
})
Office.onReady().then(function()){
返回Excel.run(函数(上下文){
}); 
})