Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub Main()
Dim objImpApp As Object
Dim objImpCat As Object
Dim objImpRep As Object
Dim objQueryItemsCol As Object ' collection
Dim objFolderItemCol As Object ' collection
Dim objTempFolderItem As Object
Dim objMetaDataItem As Object
Dim i, count As Integer
Set objImpApp = GetObject("CognosImpromptu.Application")
'objImpApp.Visible True
Set objImpCat = objImpApp.ActiveCatalog
Set objImpRep = objImpApp.ActiveDocument
Set objQueryItemsCol = objImpRep.QueryItems
Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder
MsgBox "The first folder is " & objFolderItemCol(1).Name
count = objQueryItemsCol.count
MsgBox "QueryItems.Count = " & count
For i = 1 To count
Set objTempFolderItem = objQueryItemsCol.Item(i).FolderItem
Set objMetaDataItem = objQueryItemsCol.Item(i).MetaDataItem
If (objQueryItemsCol.Item(i).FolderPath = "") Then
MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _
"Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _
"Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _
" *** FOLDER ITEM NOT FOUND *** " & Chr$(13) & _
"MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _
"MetaDataItem.Name = " & objMetaDataItem.Name
Else
MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _
"Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _
"Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _
"FolderPath = " & objQueryItemsCol.Item(i).FolderPath & Chr$(13) & _
"FolderItem.Name = " & objTempFolderItem.Name & Chr$(13) & _
"MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _
"MetaDataItem.Name = " & objMetaDataItem.Name
End If
Next i
End Sub