PowerPoint.CustomXmlPartCollection class

A collection of custom XML parts.

Extends

Remarks

[ API set: PowerPointApi 1.7 ]

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's 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

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.CustomXmlPart[];

Property Value

Method Details

add(xml)

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 1.7 ]

getByNamespace(namespaceUri)

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 1.7 ]

getCount()

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 1.7 ]

getItem(id)

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 1.7 ]

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.

getItemOrNullObject(id: string): PowerPoint.CustomXmlPart;

Parameters

id

string

ID of the object to be retrieved.

Returns

Remarks

[ API set: PowerPointApi 1.7 ]

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

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)

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

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