Deleting contents

S

SunOuchi

Hello,
While working with VBA in Word2K and files like this one here below

Open "C:\MyDocuments\Textfile" For Output As #1
Write #1, Txt
Close #1

I would like to know how to delete (with VBA) the existing contents before I
write new data to that file.
And I would like to know how to delete the file: "C:\MyDocuments\Textfile"

Thanks in advance
Hans
 
S

Steve Lang

Hi Hans,

If you want to delete the contents, you may as well delete the file.

Kill "C:\My Documents\Textfile.txt"

will do it.

HTH and have a great day!

Steve
 
Top