Excel.CellPropertiesFontLoadOptions interface

指定要在 对象上 format.font 加载的属性。

属性

bold

指定是否加载 bold 属性。

color

指定是否加载 color 属性。

italic

指定是否加载 italic 属性。

name

指定是否加载 name 属性。

size

指定是否加载 size 属性。

strikethrough

指定是否加载 strikethrough 属性。

subscript

指定是否加载 subscript 属性。

superscript

指定是否加载 superscript 属性。

tintAndShade

指定是否加载 tintAndShade 属性。

underline

指定是否加载 underline 属性。

属性详细信息

bold

指定是否加载 bold 属性。

bold?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

color

指定是否加载 color 属性。

color?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

示例

// 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();

    // 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}`);
});

italic

指定是否加载 italic 属性。

italic?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

name

指定是否加载 name 属性。

name?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

size

指定是否加载 size 属性。

size?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

strikethrough

指定是否加载 strikethrough 属性。

strikethrough?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

subscript

指定是否加载 subscript 属性。

subscript?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

superscript

指定是否加载 superscript 属性。

superscript?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

tintAndShade

指定是否加载 tintAndShade 属性。

tintAndShade?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9

underline

指定是否加载 underline 属性。

underline?: boolean;

属性值

boolean

注解

API 集:ExcelApi 1.9