Example: Displaying information about a user's streams

' Determine all the views owned by a specified user that are attached
' to all of the development streams owned by that user in all the
' projects in a particular project VOB

Dim CC As New ClearCase.Application

' Get the project VOB with tag "\projects"

Dim PVOB As CCProjectVOB
On Error Resume Next
Set PVOB = CC.ProjectVOB("\projects")
If Err.Number <> 0 Then
     MsgBox "Error getting project VOB: " & Err.Description
Else

     ' Get the projects in the project VOB and iterate through each to
     ' determine if the project has development streams attached to it

     Dim Projects As CCProjects
     Dim Name As String
     Dim Str As String
     On Error Resume Next
     Str = ""
     Set Projects = PVOB.Projects
     If Err.Number <> 0 Then
          MsgBox "Error getting projects from project VOB: " & _
          Err.Description
     Else
          MsgBox "Iterating over " & Projects.Count & " Project(s)"
          Name = "rational\jed"
          Dim Project As CCProject
          For Each Project In Projects

          ' If the project has development streams owned by "Name",
          ' get the views owned by "Name" that are attached to those streams

          If Project.HasStreams Then
               Dim Streams As CCStreams
               Dim Stream As CCStream
               Set Streams = Project.DevelopmentStreams(Name)
               For Each Stream In Streams
                    Dim Views As CCViews
                    Set Views = Stream.Views(Name)
                    Dim View As CCView
                    For Each View In Views
                        Str = Str & View.TagName & " in stream: " & _
                        Stream.Title & vbCrLf
                    Next
               Next     
          End If
          Next
     End If
     If Str = "" Then
          MsgBox "No views owned by " & Name
     Else
          MsgBox "Views owned by " & Name & " :" & vbCrLf & Str
     End If
End If

Feedback