Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append to the top of a file

Status
Not open for further replies.

ri

Programmer
Nov 2, 2000
12
GB
I currently have the code:

Function WriteLineToFile(filename)
Set AFileStream = FSO.OpenTextFile(DATA_PATH & filename, 8)
AFileStream.WriteLine filename
End Function

It writes the filename that it is passed to the correct file (which is a .dat file) ok. The problem is that it appends it on a new line at the end of the file. I need it to be put in as the first line above everything else.

Can anyone help I would really appreciate it?
 
grab the contents of the text file and store it in an array or string. write your new line over the old file, then append your array/string jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top