Saving into text file will be like this
'Open the File with a handler #1
Open "c:\xx.txt" for output as #1
Do While ...
''' ......
'''' Create your line to be printed strLine
'Write a single line
Print #1, strLine
''''' ...
Loop
'Close the file
Close #1
Now try yourself. I havent use these codes a long time.