Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Office.BindingDataChangedEventArgs interface
- Package:
- office
Provides information about the binding that raised the DataChanged event.
Remarks
Used by
Examples
// When data in a binding changes, the handler receives a BindingDataChangedEventArgs object
// containing the binding that changed and the event type.
function addDataChangeHandler() {
Office.context.document.bindings.getByIdAsync("myBinding", function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
asyncResult.value.addHandlerAsync(Office.EventType.BindingDataChanged, onDataChanged);
}
});
}
function onDataChanged(eventArgs: Office.BindingDataChangedEventArgs) {
console.log("Event type: " + eventArgs.type);
console.log("Binding ID: " + eventArgs.binding.id);
// Refresh data from the binding
eventArgs.binding.getDataAsync( { coercionType: Office.CoercionType.Text }, function (asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Updated data: " + asyncResult.value);
}
});
}
Properties
| binding | Gets an Office.Binding object that represents the binding that raised the DataChanged event. |
| type | Gets an Office.EventType enumeration value that identifies the kind of event that was raised. |
Property Details
binding
Gets an Office.Binding object that represents the binding that raised the DataChanged event.
binding: Binding;
Property Value
type
Gets an Office.EventType enumeration value that identifies the kind of event that was raised.
type: EventType;
Property Value
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
