Edit

Office.AddBindingFromNamedItemOptions interface

Provides options for configuring the binding that is created.

Remarks

Used by

Examples

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

Properties

asyncContext

A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback.

id

The unique ID of the binding. Autogenerated if not supplied.

Property Details

asyncContext

A user-defined item of any type that is returned, unchanged, in the asyncContext property of the AsyncResult object that is passed to a callback.

asyncContext?: any

Property Value

any

id

The unique ID of the binding. Autogenerated if not supplied.

id?: string

Property Value

string