Edit

Share via


PowerPoint.BindingCollection class

Represents the collection of all the binding objects that are part of the presentation.

Extends

Remarks

[ API set: PowerPointApi 1.8 ]

Properties

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

items

Gets the loaded child items in this collection.

Methods

add(shape, bindingType, id)

Adds a new binding to a particular Shape. If the provided ID is already being used by a binding, the existing binding will be overwritten.

add(shape, bindingTypeString, id)

Adds a new binding to a particular Shape. If the provided ID is already being used by a binding, the existing binding will be overwritten.

addFromSelection(bindingType, id)

Adds a new binding based on the current selection. If the selection has multiple areas, the InvalidReference error will be returned.

addFromSelection(bindingTypeString, id)

Adds a new binding based on the current selection. If the selection has multiple areas, the InvalidReference error will be returned.

getCount()

Gets the number of bindings in the collection.

getItem(key)

Gets a binding object by ID. Throws an ItemNotFoundException if there's no binding with that ID.

getItemAt(index)

Gets a binding object based on its position in the items array. Throws an InvalidArgumentException if the index less than 0, or greater than or equal to the count of items in the collection.

getItemOrNullObject(id)

Gets a binding object by ID. If the binding object doesn't exist, then this method returns an object with its isNullObject property set to true. For further information, see *OrNullObject methods and properties.

load(options)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNames)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNamesAndPaths)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original PowerPoint.BindingCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.BindingCollectionData) that contains an "items" array with shallow copies of any loaded properties from the collection's items.

Property Details

context

The request context associated with the object. This connects the add-in's process to the Office host application's process.

context: RequestContext;

Property Value

items

Gets the loaded child items in this collection.

readonly items: PowerPoint.Binding[];

Property Value

Method Details

add(shape, bindingType, id)

Adds a new binding to a particular Shape. If the provided ID is already being used by a binding, the existing binding will be overwritten.

add(shape: PowerPoint.Shape, bindingType: PowerPoint.BindingType, id: string): PowerPoint.Binding;

Parameters

shape
PowerPoint.Shape

Shape to which the binding is added.

bindingType
PowerPoint.BindingType

Type of binding. See BindingType.

id

string

ID of the binding.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

add(shape, bindingTypeString, id)

Adds a new binding to a particular Shape. If the provided ID is already being used by a binding, the existing binding will be overwritten.

add(shape: PowerPoint.Shape, bindingTypeString: "Shape", id: string): PowerPoint.Binding;

Parameters

shape
PowerPoint.Shape

Shape to which the binding is added.

bindingTypeString

"Shape"

Type of binding. See BindingType.

id

string

ID of the binding.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

addFromSelection(bindingType, id)

Adds a new binding based on the current selection. If the selection has multiple areas, the InvalidReference error will be returned.

addFromSelection(bindingType: PowerPoint.BindingType, id: string): PowerPoint.Binding;

Parameters

bindingType
PowerPoint.BindingType

Type of binding. See BindingType.

id

string

ID of the binding.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

addFromSelection(bindingTypeString, id)

Adds a new binding based on the current selection. If the selection has multiple areas, the InvalidReference error will be returned.

addFromSelection(bindingTypeString: "Shape", id: string): PowerPoint.Binding;

Parameters

bindingTypeString

"Shape"

Type of binding. See BindingType.

id

string

ID of the binding.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

getCount()

Gets the number of bindings in the collection.

getCount(): OfficeExtension.ClientResult<number>;

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

getItem(key)

Gets a binding object by ID. Throws an ItemNotFoundException if there's no binding with that ID.

getItem(key: string): PowerPoint.Binding;

Parameters

key

string

ID of the binding object to be retrieved.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

getItemAt(index)

Gets a binding object based on its position in the items array. Throws an InvalidArgumentException if the index less than 0, or greater than or equal to the count of items in the collection.

getItemAt(index: number): PowerPoint.Binding;

Parameters

index

number

Index value of the object to be retrieved. Zero-indexed.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

getItemOrNullObject(id)

Gets a binding object by ID. If the binding object doesn't exist, then this method returns an object with its isNullObject property set to true. For further information, see *OrNullObject methods and properties.

getItemOrNullObject(id: string): PowerPoint.Binding;

Parameters

id

string

ID of the binding object to be retrieved.

Returns

Remarks

[ API set: PowerPointApi 1.8 ]

load(options)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(options?: PowerPoint.Interfaces.BindingCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.BindingCollection;

Parameters

options

PowerPoint.Interfaces.BindingCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions

Provides options for which properties of the object to load.

Returns

load(propertyNames)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNames?: string | string[]): PowerPoint.BindingCollection;

Parameters

propertyNames

string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns

load(propertyNamesAndPaths)

Queues up a command to load the specified properties of the object. You must call context.sync() before reading the properties.

load(propertyNamesAndPaths?: OfficeExtension.LoadOption): PowerPoint.BindingCollection;

Parameters

propertyNamesAndPaths
OfficeExtension.LoadOption

propertyNamesAndPaths.select is a comma-delimited string that specifies the properties to load, and propertyNamesAndPaths.expand is a comma-delimited string that specifies the navigation properties to load.

Returns

toJSON()

Overrides the JavaScript toJSON() method in order to provide more useful output when an API object is passed to JSON.stringify(). (JSON.stringify, in turn, calls the toJSON method of the object that's passed to it.) Whereas the original PowerPoint.BindingCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.BindingCollectionData) that contains an "items" array with shallow copies of any loaded properties from the collection's items.

toJSON(): PowerPoint.Interfaces.BindingCollectionData;

Returns