PowerPoint.CustomXmlPartScopedCollection class

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

A scoped collection of custom XML parts. A scoped collection is the result of some operation (such as filtering by namespace). A scoped collection cannot be scoped any further.

Extends

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

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

getCount()

Gets the number of custom XML parts in this collection.

getItem(id)

Gets a CustomXmlPart based on its ID.

getItemOrNullObject(id)

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

getOnlyItem()

If the collection contains exactly one item, this method returns it. If the collection contains no items or more than one item, then this method returns the GeneralException error.

getOnlyItemOrNullObject()

If the collection contains exactly one item, this method returns it. Otherwise, this method returns null.

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 is passed to it.) Whereas the original PowerPoint.CustomXmlPartScopedCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.CustomXmlPartScopedCollectionData) that contains an "items" array with shallow copies of any loaded properties from the collection's items.

Property Details

context

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

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

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the loaded child items in this collection.

readonly items: PowerPoint.CustomXmlPart[];

Property Value

Method Details

getCount()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets the number of custom XML parts in this collection.

getCount(): OfficeExtension.ClientResult<number>;

Returns

The number of custom XML parts in the collection.

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getItem(id)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets a CustomXmlPart based on its ID.

getItem(id: string): PowerPoint.CustomXmlPart;

Parameters

id

string

ID of the object to be retrieved.

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getItemOrNullObject(id)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Gets a CustomXmlPart based on its ID. If the CustomXmlPart 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.CustomXmlPart;

Parameters

id

string

ID of the object to be retrieved.

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getOnlyItem()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

If the collection contains exactly one item, this method returns it. If the collection contains no items or more than one item, then this method returns the GeneralException error.

getOnlyItem(): PowerPoint.CustomXmlPart;

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getOnlyItemOrNullObject()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

If the collection contains exactly one item, this method returns it. Otherwise, this method returns null.

getOnlyItemOrNullObject(): PowerPoint.CustomXmlPart;

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

load(options)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

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.CustomXmlPartScopedCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions): PowerPoint.CustomXmlPartScopedCollection;

Parameters

options

PowerPoint.Interfaces.CustomXmlPartScopedCollectionLoadOptions & PowerPoint.Interfaces.CollectionLoadOptions

Provides options for which properties of the object to load.

Returns

load(propertyNames)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

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.CustomXmlPartScopedCollection;

Parameters

propertyNames

string | string[]

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

Returns

load(propertyNamesAndPaths)

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

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.CustomXmlPartScopedCollection;

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()

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

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 is passed to it.) Whereas the original PowerPoint.CustomXmlPartScopedCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.CustomXmlPartScopedCollectionData) that contains an "items" array with shallow copies of any loaded properties from the collection's items.

toJSON(): PowerPoint.Interfaces.CustomXmlPartScopedCollectionData;

Returns