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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top