Excel.CellPropertiesFontLoadOptions interface

Specifies which properties to load on the format.font object.

Remarks

[ API set: ExcelApi 1.9 ]

Properties

bold

Specifies whether to load the bold property.

color

Specifies whether to load the color property.

italic

Specifies whether to load the italic property.

name

Specifies whether to load the name property.

size

Specifies whether to load the size property.

strikethrough

Specifies whether to load the strikethrough property.

subscript

Specifies whether to load the subscript property.

superscript

Specifies whether to load the superscript property.

tintAndShade

Specifies whether to load the tintAndShade property.

underline

Specifies whether to load the underline property.

Property Details

bold

Specifies whether to load the bold property.

bold?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

color

Specifies whether to load the color property.

color?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

Examples

// 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

Specifies whether to load the italic property.

italic?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

name

Specifies whether to load the name property.

name?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

size

Specifies whether to load the size property.

size?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

strikethrough

Specifies whether to load the strikethrough property.

strikethrough?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

subscript

Specifies whether to load the subscript property.

subscript?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

superscript

Specifies whether to load the superscript property.

superscript?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

tintAndShade

Specifies whether to load the tintAndShade property.

tintAndShade?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]

underline

Specifies whether to load the underline property.

underline?: boolean;

Property Value

boolean

Remarks

[ API set: ExcelApi 1.9 ]