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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output File Overwrite problem

Status
Not open for further replies.

klornpallier

Technical User
Aug 28, 2002
98
GB
Hi, I have the code to save a filename to a log file as below:
FilenameA = "C:\ArchivedMails.log"
Open FilenameA For Output As #1

Print #1, FileName

Close #1

This works fine but within the file I want to add new filenames each time the code is run. At present it is overwriting the file.
 
Hi
If you want a new file each time, how about (?):
FilenameA= "c:\AM" & Format(Time, "hhmmss") & ".log"
 
And what about this ?
Open FilenameA For Append As #1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top