'This script prints all open Grapher plot and worksheet windows

Sub Main

  'Create Grapher as an object
  Dim Grapher As Object

  'Start Grapher
  Set Grapher = CreateObject("Grapher.Application")

  'Make Grapher visible
  Grapher.Visible = True

  'Print all graphs that are currently open
	i=1
    While i < Grapher.Documents.Count+1

    'Step through each of the open windows and print
    Grapher.Documents.Item(i).PrintOut

    'uncomment the next line if you want the script to close the window
    'doc.Close()

    'Open the next file
    i = i+1
  Wend

End Sub
