Use this property to retrieve 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. Receives the target object of the specified relationship. See the "Remarks" section for an exception. |
object | The relationship collection. |
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 only be used 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 will receive the specified VersionedRelationship object instead of the relationship's target object. In this case, you should declare your variable as a VersionedRelationship instead of a RepositoryObject. Each item in the collection is a versioned relationship — it 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), Repository chooses a particular version of the target object from the items in the versioned relationship's TargetVersions collection.
For details on how to access a member of an interface that is not the default interface, see Accessing Automation Object Members.