Word.ContentControlState enum

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

コンテンツ コントロールの状態を表します。

注釈

API セット: WordApi ベータ版 (プレビューのみ)

使用元

例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/insert-and-change-content-controls.yaml

// Marks the sample content control with a warning.
await Word.run(async (context) => {
    const sampleControl: Word.ContentControl = context.document.contentControls
        .getByTag("ContentControlStateSample").getFirstOrNullObject();
    await context.sync();

    if (sampleControl.isNullObject) {
        console.warn("Run Set up to create the sample content control.");
        return;
    }

    const state: Word.ContentControlState = Word.ContentControlState.warning;
    sampleControl.setState(state);
    await context.sync();
    console.log(`Set sample content control state to ${state}.`);
});

フィールド

error = "Error"

エラー状態。

warning = "Warning"

警告状態。