' 最上位の Rational ClearCase アプリケーション オブジェクトに接続します。
Dim CC As New ClearCase.Application
' チェックアウト済みファイルを取得するためのクエリー オブジェクトを作成します。
Dim COQuery As CCCheckedOutFileQuery
Set COQuery = CC.CreateCheckedOutFileQuery
' 使用するパスの配列をセットアップします。
COQuery.PathArray = Array("m:¥carol_main¥caroltest", _
"m:¥carol_main¥stage", "m:¥carol_main¥policy")
' コレクションを、ユーザー "bill" によってチェックアウトされたファイルに限定します。
COQuery.User = "bill"
' コレクションに、パスの配列で指定された VOB のチェックアウト済み
' ファイルをすべて含めます。
COQuery.PathSelects = ccSelection_AllInVOB
' クエリーを適用し、CCCheckedOutFiles コレクションを取得します。
Dim CheckedOutFiles As CCCheckedOutFiles
Set CheckedOutFiles = COQuery.Apply
Dim strMsg As String
Dim strView As String
strMsg = CheckedOutFiles.Count & " files are checked out: "
' 表示のために、チェックアウト済みのファイルについての情報を集めます。
Dim I As Long
For I = 1 To CheckedOutFiles.Count
Dim COFile As CCCheckedOutFile
Set COFile = CheckedOutFiles(I)
On Error Resume Next
' ファイルのチェックアウト先のビューを取得します。
strView = COFile.ByView
If Err.Number <> 0 Then
strView = "<could not get view>"
End If
' ファイルのチェックアウト先のブランチを取得します。
strMsg = strMsg & vbCrLf & COFile.Path & _
" branch " & COFile.Branch & " to view " & strView
Next
' 結果を表示します。
MsgBox strMsg