1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'Solution ID:  100007666 

'Title: Printing the data filename In the footer 

'Description:
'Q. 
'Is there a way To Get the data file Name To appear In the footer of my SPSS Output document when it's printed? 

'A. 
'Yes. If you are using SPSS 7.5 Or above, save the following As an SPSS Script file (With an extension of .sbs). Run the script, e.g. With Utilities>Run Script, And it will place "Data: " followed by the Name of the current data file, As the footer of the designated Output document. 

'You might want To use the Menu Editor Or customize a toolbar button To trigger the script. 

'------ save the following As "DataFooter.sbs" --------------- 

Sub Main 
Dim strFile As String 
On Error Resume Next 

With objSpssApp 
strFile = .Documents.GetDataDoc(0).GetDocumentPath 
.GetDesignatedOutputDoc.PrintOptions.FooterText = "Data: " & strFile 
End With 
End Sub