次の方法で共有


Excel.ConditionalTextOperator enum

テキストの条件付き書式の種類の演算子を表します。

注釈

[ API セット: ExcelApi 1.6 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/14-conditional-formatting/conditional-formatting-basic.yaml

await Excel.run(async (context) => {
    const sheet = context.workbook.worksheets.getItem("Sample");
    const range = sheet.getRange("B16:D18");
    const conditionalFormat = range.conditionalFormats
        .add(Excel.ConditionalFormatType.containsText);
    conditionalFormat.textComparison.format.font.color = "red";
    conditionalFormat.textComparison.rule = { operator: Excel.ConditionalTextOperator.contains, text: "Delayed" };

    await context.sync();
});

フィールド

beginsWith = "BeginsWith"
contains = "Contains"
endsWith = "EndsWith"
invalid = "Invalid"
notContains = "NotContains"