Office.AddBindingFromSelectionOptions interface
提供用于标识所创建绑定的选项。
注解
使用方
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/03-bindings/manage-bindings.yaml
// Creates a text binding from the current selection.
const options: Office.AddBindingFromSelectionOptions = { id: bindingId };
Office.context.document.bindings.addFromSelectionAsync(
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}".`);
}
);
属性
| async |
在传递到回调的 AsyncResult 对象的 asyncContext 属性中返回的任何类型的用户定义项,保持不变。 |
| columns | 绑定中涉及的列的名称。 |
| id | 绑定的唯一 ID。 如果未提供,则自动生成。 |
属性详细信息
asyncContext
在传递到回调的 AsyncResult 对象的 asyncContext 属性中返回的任何类型的用户定义项,保持不变。
asyncContext?: any
属性值
any
columns
绑定中涉及的列的名称。
columns?: string[]
属性值
string[]
id
绑定的唯一 ID。 如果未提供,则自动生成。
id?: string
属性值
string