Share via


childrenCollection object

The childrenCollection object represents a collection of WPDObjects.

Members

The childrenCollection object has these types of members:

Properties

The childrenCollection object has these properties.

Property Access type Description
Count
Read-only
Gets the number of WPDObjects in the collection.

Remarks

An object contained in a childrenCollection can be accessed by a zero-based numeric index, by a Persistent Unique Id (PUID), or by an Object Identifier (ObjectID).

Examples

The following JScript example demonstrates two ways of creating a childrenCollection object, and shows all three ways of accessing an object in the collection. This example assumes that the PUID and ObjectID of a specific child is known. For more information on retrieving the PUID or ObjectID for an object, see Enumerating Services and Storages.

// Retrieve a collection of all the children in a WPDObject.

var childrenCollection = wpdObject.Children;

// Retrieve a collection of children in a WPDObject for the specified
// data formats.
 
var childrenCollectionByFormat = wpdObject.GetChildrenByFormat(["Wma", "Mp3"]);

// Enumerate the children in the collection.

for (i=0; i < childrenCollection.Count; i++)
{
    // Access a child object by numeric index.
    var aChild = childrenCollection[i]; 
}
     
// Access a specific child object by PUID.

var aChildByPUID = childrenCollection["somePUID"];

// Access a specific child object by ObjectID.

var aChildByObjectID = childrenCollection["someObjectID"];

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]

See also

About the childrenCollection Object

Enumerating Services and Storages

servicesCollection Object

storagesCollection Object

WPD Automation Reference

WPDObject