Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wave files 1

Status
Not open for further replies.

jizviz

Programmer
Oct 13, 2002
26
0
0
US
I have many wave files in a directory. The names of these wave files contain the phone number of the customer plus other data. I need to do a search of the directory for a file whose name contains the phone number. All I can provide is the phone number. I need to find the file, obtain the complete file name, and then load it into the mmcontrol. Please help. Thanks!
 
Something like this ought to work... Make sure you add a reference to 'Microsoft Scripting Runtime'

Dim FSO As Scripting.FileSystemObject
Dim oFile As Scripting.File

Set FSO = CreateObject("Scripting.FileSystemObject")
For Each oFile In FSO.GetFolder("C:\").Files
If InStr(oFile.Name, "Search String") > 0 Then
' load in to mmControl
End If
Next
Set oFile = Nothing
Set FSO = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top