Binding object (JavaScript API for Office v1.0)

JavaScript API for Office v1.0

An abstract class that represents a binding to a section of the document.

Last modified: June 12, 2014

Office.context.document.bindings.getByIdAsync(id);
Office.select("bindings#id);

Objects

Name

Description

MatrixBinding

Represents a binding in two dimensions of rows and columns.

TableBinding

Represents a binding in two dimensions of rows and columns, optionally with headers.

TextBinding

Represents a bound text selection in the document.

Properties

Name

Description

document

Get the Document object associated with the binding.

id

Gets the identifier of the object.

type

Gets the type of the binding.

Methods

Name

Description

addHandlerAsync

Adds a handler to the binding for the specified event type.

getDataAsync

Returns the data contained within the binding.

removeHandlerAsync

Removes the specified handler from the binding for the specified event type.

setDataAsync

Writes data to the bound section of the document represented by the specified binding object.

Events

Name

Description

dataChanged

Occurs when data within the binding is changed.

selectionChanged

Occurs when the selection is changed within the binding.

The Binding object exposes the functionality possessed by all bindings regardless of type.

The Binding object is never called directly. It is the abstract parent class of the objects that represent each type of binding: MatrixBinding, TableBinding, or TextBinding. All three of these objects inherit the getDataAsync and setDataAsync methods from the Binding object that enable to you interact with the data in the binding. They also inherit the id and type properties for querying those property values. Additionally, the MatrixBinding and TableBinding objects expose additional methods for matrix- and table-specific features, such as counting the number of rows and columns.

Supported clients

Excel 2013, Excel 2013 RT, Excel Online, Word 2013, Word 2013 RT

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft