Overwriting existing text file

petko

Registered User.
Local time
Today, 17:59
Joined
Jun 9, 2007
Messages
89
Hello,

I'm making a text file with the help of the following procedure:

FileNum = FreeFile
Open "path\filename.txt" For Append As #FileNum
Print #FileNum, "Content"
Close #FileNum

Could someone advise a procedure that would create the file (like this example) if the given path\name does not exist or if exists then it would make an overwrite (meaning deleting the existing content and make a new content according to the "Content" string)?

Apprechiating any help

Peter
 
Open "path\filename.txt" For Output As #FileNum

append adds to an existing file
output creates a new file
 

Users who are viewing this thread

Back
Top Bottom