PowerPoint.CustomXmlPartCollection 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 collection of custom XML parts.

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

add(xml)

Adds a new CustomXmlPart to the collection.

getByNamespace(namespaceUri)

Gets a new scoped collection of custom XML parts whose namespaces match the given namespace.

getCount()

Gets the number of custom XML parts in the 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.

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.CustomXmlPartCollection object is an API object, the toJSON method returns a plain JavaScript object (typed as PowerPoint.Interfaces.CustomXmlPartCollectionData) 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

add(xml)

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.

Adds a new CustomXmlPart to the collection.

add(xml: string): PowerPoint.CustomXmlPart;

Parameters

xml

string

XML content. Must be a valid XML fragment. If the XML fragment is invalid, then this method returns the GeneralException error.

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

getByNamespace(namespaceUri)

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 new scoped collection of custom XML parts whose namespaces match the given namespace.

getByNamespace(namespaceUri: string): PowerPoint.CustomXmlPartScopedCollection;

Parameters

namespaceUri

string

This must be a fully qualified schema URI, such as "http://schemas.contoso.com/review/1.0".

Returns

Remarks

[ API set: PowerPointApi BETA (PREVIEW ONLY) ]

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 the 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) ]

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

Parameters

options

PowerPoint.Interfaces.CustomXmlPartCollectionLoadOptions & 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.CustomXmlPartCollection;

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

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

toJSON(): PowerPoint.Interfaces.CustomXmlPartCollectionData;

Returns