newVBuser
Programmer
- Jan 5, 2009
- 3
Hi,
I've got this code which deletes a file using VB:
Dim FileToDel As String
FileToDel = "C:\SomeFileName.txt"
If System.IO.File.Exists(FileToDel) = True Then
System.IO.File.Delete(FileToDel)
MsgBox("File has been successfully deleted")
End If
Is there a way to delete a collection of files at once when they share the same name but have different extensions? I.e...
FileName.doc
FileName.csv
FileName.ppt
FileName.dbf
FileName.txt
etc....
Thanks
I've got this code which deletes a file using VB:
Dim FileToDel As String
FileToDel = "C:\SomeFileName.txt"
If System.IO.File.Exists(FileToDel) = True Then
System.IO.File.Delete(FileToDel)
MsgBox("File has been successfully deleted")
End If
Is there a way to delete a collection of files at once when they share the same name but have different extensions? I.e...
FileName.doc
FileName.csv
FileName.ppt
FileName.dbf
FileName.txt
etc....
Thanks