Relationship collections can be retrieved at both the COM and Automation level.
To retrieve a relationship, first declare a variable as a RelationshipCol object (that is, an object that implements the IRelationshipCol interface). Next, set the variable equal to the object member that is the collection you want to retrieve.
For example, the following Microsoft® Visual Basic® code retrieves a collection of bug discoveries (a relationship collection) belonging to a particular person into the variable called DiscoveryCollection:
DIM DiscoveryCollection As RelationshipCol
DIM Person As RepositoryObjectVersion
REM Retrieve the source object into the Person variable
Set DiscoveryCollection = Person.bugs
In this example, DiscoveryCollection(1) refers to the first relationship in the collection.
To retrieve a relationship, you can perform the following steps:
The Invoke method will pass an IDispatch interface pointer for the collection back to you.