'================================================================================ 'SavingReportFile.BAS ' 'This script demonstrates: ' Grid a sample data file ' Create a Grid Report ' Save the grid report ' '================================================================================ Sub Main 'Declare the variable that will reference the application Dim Surf As Object 'Creates an instance of the Surfer Application object 'and assigns it to the variable named "Surf" Set Surf = CreateObject("Surfer.Application") 'Makes Surfer Visible Surf.Visible = True 'Assigns the location of the data and grid files to the variable "Path" path1 = Surf.Path + "\samples\" 'Select the data file to grid infile= path1+"demogrid.dat" 'Creates a plot document in Surfer and assigns it to the variable "Plot" Dim Plot As Object Set Plot = Surf.Documents.Add 'Grid the data and include the Grid Report Surf.GridData(infile,ShowReport:=True, OutGrid:=path1+"test.grd") 'Control the Grid Report to save the file AppActivate "Surfer - GridDataReport" Wait 1 SendKeys "{Menu}+F+S Wait 1 SendKeys "test.rtf + {Enter}" Wait 1 SendKeys "{Menu}+F+C" 'Exits Surfer Surf.Quit End Sub