'Author: Raynald Levesque Sub main() Call ExportIGraphs("c:\\temp\\test.spo","title") End Sub Sub ExportIGraphs(OutputFile As String, TitleStart As String) ' This script comes from SPSS Help ' Declare variables. Dim objOutputDoc As ISpssOutputDoc Dim objOutputItems As ISpssItems Dim objOutputItem As ISpssItem Dim objSPSSIGraph As ISpssIGraph Dim intItemCount As Integer 'number of output items Dim intItemType As Integer 'type of item (see SpssType property) Dim strLabel As String 'Item label ' Open saved output document specified by the OutputFile parameter ' and make it visible. Set objOutputDoc = objSpssApp.OpenOutputDoc(OutputFile) objOutputDoc.Visible = True ' Get Output Items collection. Set objOutputItems = objOutputDoc.Items() ' Iterate through output items. intItemCount = objOutputItems.Count() For Index = 0 To intItemCount - 1 Set objOutputItem = objOutputItems.GetItem(Index) intItemType = objOutputItem.SPSSType() strLabel = objOutputItem.Label ' If item is a chart, modify its title, subtitle, and caption, then ' activate and export it. If intItemType = SPSSIGraph Then Set objSPSSIGraph = objOutputItem.GetIGraphOleObject objSPSSIGraph.DeleteSubtitle objSPSSIGraph.DeleteCaption objSPSSIGraph.Title = TitleStart & " " & Index + 1 objSPSSIGraph.ExportChart "c:\\temp\\mychart100.jpg", "JPEG File", 300, 300, 1, 0 Exit For End If Next Index End Sub