'Begin Description 'This script saves the current Designated Output window, closes it and Open a new one 'The path and filename are specified at the beginning of the script 'rlevesque@videotron.ca 'End Description Option Explicit Sub Main Dim objOutputDoc As ISpssOutputDoc Dim strParam As String Dim i As Integer Dim objDocuments As ISpssDocuments Dim strPath As String Dim strFileName As String ' ******** Change the next 2 lines as required strPath = "c:\\temp\\" 'If this is left blank, current folder will be used strFileName = "FileName.spo" Set objDocuments = objSpssApp.Documents If objDocuments.OutputDocCount > 0 Then Set objOutputDoc = objSpssApp.GetDesignatedOutputDoc 'check to see if there is a specified path If InStr(strPath, "\\") > 0 Then objOutputDoc.SaveAs strPath & strFileName Else 'if no path specified, use the current directory objOutputDoc.SaveAs objSpssApp.GetSPSSPath & strFileName End If End If 'close the OutputDoc ... objOutputDoc.Close 'open a new window and make it visible objSpssApp.NewOutputDoc objSpssApp.NewOutputDoc.Visible = True End Sub