writing to txt files

  • Thread starter Thread starter mudraker
  • Start date Start date
M

mudraker

Open sFile(2) For Append As #1
To Append (add to the bottom of an existing text file

Open "C:\tempfolder\temp.txt" For Append As #
 
I am wanting to write to the end of an existing text file. the following
works however I am sure their is a better way. i.e. not having to open it
twice!!


Open "C:\tempfolder\temp.txt" For Input As #1
iData = ""
Do While Not EOF(1)
Line Input #1, textLine
iData = iData & textLine
Loop
Close #1

Open "C:\tempfolder\temp.txt" For Output As #1
Print #1, iData & Chr(10) & iHist
Close #1
 
Back
Top