PowerPoint.CustomXmlPartScopedCollection class
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 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
get |
Gets the number of custom XML parts in this collection. |
get |
Gets a |
get |
Gets a |
get |
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 |
get |
If the collection contains exactly one item, this method returns it. Otherwise, this method returns |
load(options) | Queues up a command to load the specified properties of the object. You must call |
load(property |
Queues up a command to load the specified properties of the object. You must call |
load(property |
Queues up a command to load the specified properties of the object. You must call |
toJSON() | Overrides the JavaScript |
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
getCount()
Gets the number of custom XML parts in this collection.
getCount(): OfficeExtension.ClientResult<number>;
Returns
OfficeExtension.ClientResult<number>
The number of custom XML parts in the collection.
Remarks
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
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
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.
getOnlyItem(): PowerPoint.CustomXmlPart;
Returns
Remarks
getOnlyItemOrNullObject()
If the collection contains exactly one item, this method returns it. Otherwise, this method returns null
.
getOnlyItemOrNullObject(): PowerPoint.CustomXmlPart;
Returns
Remarks
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.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)
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)
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()
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.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
Office Add-ins