1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'David, the following script adds a title Object Text In the active Output navigator,
'containing All visible table's title.
'HTH
'Fabrizio

 Sub Main
 Dim objOutDoc As ISpssOutputDoc, objItems As ISpssItems, objPivot As PivotTable
 Dim Txt As String, ItemIndex As Long
    'Continue the program only if there is at least one output document.
    If objSpssApp.Documents.OutputDocCount > 0 Then
       'Get the currently designated output document items collection.
       Set objOutDoc = objSpssApp.GetDesignatedOutputDoc
       Set objItems = objOutDoc.Items
    Else
            MsgBox "No Navigator window exists"
            Exit Sub
    End If

    Txt=""
     For ItemIndex=0 To objItems.Count-1
         With objItems.GetItem(ItemIndex)
            If .SPSSType=SPSSPivot And .Visible Then
               Set objPivot=.ActivateTable
               Txt=Txt+objPivot.TitleText+vbCr+vbCr
               .Deactivate
            End If
        End With
     Next ItemIndex
     ObjOutDoc.InsertTitle "Tables title", Txt
 End Sub