B
brian
I use the following vb function to delete .ord files in
our 5 gig directory. Now I need to delete about 15 other
extentions out of the directory. Is there a way to group
all the extensions together? I can only get it done by
creating the code for each extension.
Thanks
Function SimpleSearch()
' Perform simple search using the FileSearch object.
Dim varFile As Variant
With Application.FileSearch
.NewSearch
.FileName = "*.ord"
.LookIn = "g:\Orders\"
.Execute
.SearchSubFolders = True
For Each varItem In .FoundFiles
Debug.Print varItem
Kill (varItem)
Next varItem
End With
MsgBox "end"
End Function
our 5 gig directory. Now I need to delete about 15 other
extentions out of the directory. Is there a way to group
all the extensions together? I can only get it done by
creating the code for each extension.
Thanks
Function SimpleSearch()
' Perform simple search using the FileSearch object.
Dim varFile As Variant
With Application.FileSearch
.NewSearch
.FileName = "*.ord"
.LookIn = "g:\Orders\"
.Execute
.SearchSubFolders = True
For Each varItem In .FoundFiles
Debug.Print varItem
Kill (varItem)
Next varItem
End With
MsgBox "end"
End Function