Excel.CellPropertiesLoadOptions interface

表示在用作“range.getCellProperties”方法的一部分时要加载的单元格属性。

API 集:ExcelApi 1.9

属性

address

指定是否在属性上 address 加载。

API 集:ExcelApi 1.9

addressLocal

指定是否在属性上 addressLocal 加载。

API 集:ExcelApi 1.9

format

指定是否在属性上 format 加载。

API 集:ExcelApi 1.9

hidden

指定是否在属性上 hidden 加载。

API 集:ExcelApi 1.9

hyperlink

指定是否在属性上 hyperlink 加载。

API 集:ExcelApi 1.9

style

指定是否在属性上 style 加载。

API 集:ExcelApi 1.9

textRuns

指定是否在属性上 textRuns 加载。

属性详细信息

address

指定是否在属性上 address 加载。

API 集:ExcelApi 1.9

address?: boolean;

属性值

boolean

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/cell-properties.yaml

await Excel.run(async (context) => {
    const cell = context.workbook.getActiveCell();

    // Get only the properties requested in this load-options object.
    const propertiesToGet: Excel.CellPropertiesLoadOptions = {
        address: true,
        format: {
            fill: {
                color: true
            },
            font: {
                bold: true,
                color: true
            }
        },
        style: true
    };
    const cellProperties = cell.getCellProperties(propertiesToGet);

    await context.sync();
    const activeCellProperties: Excel.CellProperties = cellProperties.value[0][0];
    console.log(JSON.stringify(activeCellProperties, null, 2));
});

addressLocal

指定是否在属性上 addressLocal 加载。

API 集:ExcelApi 1.9

addressLocal?: boolean;

属性值

boolean

format

指定是否在属性上 format 加载。

API 集:ExcelApi 1.9

format?: Excel.CellPropertiesFormatLoadOptions;

属性值

hidden

指定是否在属性上 hidden 加载。

API 集:ExcelApi 1.9

hidden?: boolean;

属性值

boolean

指定是否在属性上 hyperlink 加载。

API 集:ExcelApi 1.9

hyperlink?: boolean;

属性值

boolean

style

指定是否在属性上 style 加载。

API 集:ExcelApi 1.9

style?: boolean;

属性值

boolean

textRuns

指定是否在属性上 textRuns 加载。

textRuns?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.18