通过


Excel.SettingsChangedEventArgs interface

提供有关引发设置更改事件的设置的信息

注解

[ API 集:ExcelApi 1.4 ]

示例

async function registerSettingsChangedHandler() {
    await Excel.run(async (context) => {
        // Register the onChanged setting event handler on the workbook.
        const settings = context.workbook.settings; 
        settings.onSettingsChanged.add(onChangedSetting);
        await context.sync();
    });
}

async function onChangedSetting(args: Excel.SettingsChangedEventArgs) {
    await Excel.run(async (context) => {
        const changedSetting = args.settings.getItem("NeedsReview");
        changedSetting.load("value");

        // Must sync with the context in the EventArgs object, 
        // not the context that Office passes to Excel.run. 
        await args.settings.context.sync();

        console.log("Setting value is: " + changedSetting.value);
        await context.sync();
    });
} 

属性

settings

获取表示 Setting 引发设置更改事件的绑定的对象

属性详细信息

settings

获取表示 Setting 引发设置更改事件的绑定的对象

settings: Excel.SettingCollection;

属性值

注解

[ API 集:ExcelApi 1.4 ]