Excel.CellPropertiesLoadOptions interface

表示在用作 "getCellProperties" 方法的一部分时要加载的单元格属性。Represents which cell properties to load, when used as part of a "range.getCellProperties" method.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

属性

address

指定是否在address属性上进行加载。Specifies whether to load on the address property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

addressLocal

指定是否在addressLocal属性上进行加载。Specifies whether to load on the addressLocal property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

format

指定是否在format属性上进行加载。Specifies whether to load on the format property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

hidden

指定是否在hidden属性上进行加载。Specifies whether to load on the hidden property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

hyperlink

指定是否在hyperlink属性上进行加载。Specifies whether to load on the hyperlink property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

style

指定是否在style属性上进行加载。Specifies whether to load on the style property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

属性详细信息

address

指定是否在address属性上进行加载。Specifies whether to load on the address property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

address?: boolean;

属性值

boolean

示例Examples

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

    // Define the cell properties to get by setting the matching LoadOptions to true.
    const propertiesToGet = cell.getCellProperties({
        address: true,
        format: {
            fill: {
                color: true
            },
            font: {
                color: true
            }
        },
        style: true
    });

    // Sync to get the data from the workbook.
    await context.sync();
    const cellProperties = propertiesToGet.value[0][0];
    console.log(
        `Address: ${cellProperties.address}\nStyle: ${cellProperties.style}\nFill Color: ${cellProperties.format.fill.color}\nFont Color: ${cellProperties.format.font.color}`);
});

addressLocal

指定是否在addressLocal属性上进行加载。Specifies whether to load on the addressLocal property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

addressLocal?: boolean;

属性值

boolean

format

指定是否在format属性上进行加载。Specifies whether to load on the format property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

format?: Excel.CellPropertiesFormatLoadOptions;

属性值

hidden

指定是否在hidden属性上进行加载。Specifies whether to load on the hidden property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

hidden?: boolean;

属性值

boolean

指定是否在hyperlink属性上进行加载。Specifies whether to load on the hyperlink property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

hyperlink?: boolean;

属性值

boolean

style

指定是否在style属性上进行加载。Specifies whether to load on the style property.

[API 集: ExcelApi 1.9][ API set: ExcelApi 1.9 ]

style?: boolean;

属性值

boolean