Office.AddBindingFromNamedItemOptions interface

作成されるバインドを構成するためのオプションを指定します。

注釈

使用元

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/03-bindings/manage-named-item-binding.yaml

// Creates a text binding from the title of a Rich Text content control.
const options: Office.AddBindingFromNamedItemOptions = { id: bindingId };
Office.context.document.bindings.addFromNamedItemAsync(
    namedItemTitle,
    Office.BindingType.Text,
    options,
    (asyncResult) => {
        if (asyncResult.status === Office.AsyncResultStatus.Failed) {
            console.error(asyncResult.error.message);
            return;
        }

        console.log(`Created binding "${asyncResult.value.id}" of type "${asyncResult.value.type}".`);
    }
);

プロパティ

asyncContext

コールバックに渡される AsyncResult オブジェクトの asyncContext プロパティで変更されずに返される、任意の型のユーザー定義項目。

id

バインドの一意の ID。 指定されていない場合は自動生成されます。

プロパティの詳細

asyncContext

コールバックに渡される AsyncResult オブジェクトの asyncContext プロパティで変更されずに返される、任意の型のユーザー定義項目。

asyncContext?: any

プロパティ値

any

id

バインドの一意の ID。 指定されていない場合は自動生成されます。

id?: string

プロパティ値

string