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
 

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

Top