Delete files in directory

L

Lee Taylor-Vaughan

How can i delete files in a directory by clicking a command button.
i.e. C:\Prog\*.pdf

THanks
Lee
 
D

Dirk Goldgar

Lee Taylor-Vaughan said:
How can i delete files in a directory by clicking a command button.
i.e. C:\Prog\*.pdf


For example:

'----- start of example code ------
Private Sub cmdDeletePDFs_Click()

Kill "C:\Prog\*.pdf"

End Sub
'----- end of example code ------

Of course, you have to have delete permissions on the folder and files.
 

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