This property retrieves a target object or relationship from the collection. This is a read-only property. There are three variations of this property.
Set variable = object.Item(index)
Set variable = object.Item(objName)
Set variable = object.Item(objId)
The Item property syntax has the following parts.
Part | Description |
---|---|
variable | A variable declared as a RepositoryObject class. It receives the target object of the specified relationship or the VersionedRelationship object. |
object | An object expression that evaluates to a RelationshipCol object. |
index | The index of the relationship to be retrieved from the collection. |
objName | The name that the relationship uses to refer to its destination object. This variation can be used only when the target object is also the destination object, and when the collection requires names for destination objects. |
objId | The object identifier for the target object to be retrieved from the collection. |
This property is available on two interfaces: the default interface, ITargetObjectCol, and a second interface, IRelationshipCol. If you choose to access the property that is exposed by the IRelationshipCol interface, your variable receives the specified VersionedRelationship object instead of the relationship's target object. In this case, you should declare your variable as a VersionedRelationship, instead of as a RepositoryObject. Each item in the collection is a versioned relationship; each item has a TargetVersions collection. When you obtain a reference to the target object of a particular item (with the get_Target method of the IRelationship interface), the repository engine chooses a particular version of the target object from the items in the versioned relationship's TargetVersions collection.
For more information about accessing a member of an interface that is not the default interface, see Accessing Automation Object Members.