can you tell your program to open every file in a folder or would you have to know the names of the files?
Printable View
can you tell your program to open every file in a folder or would you have to know the names of the files?
You can have the program find the names of the files, but you can only open a file if you know its name. You can't use a wildcard in an Open statement.
Hi again :p
If you'd add a FileListBox, you could set the path (and pattern if you'd only like to run a specific type of file) and then in an array run all the files
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 'ShellExecute is an API to execute files Const SW_SHOWNORMAL = 1 Private Sub Form_Load() File1.Path = YOURFOLDER DoEvents For i = 0 to File1.ListCount - 1 ShellExecute Me.hwnd, vbNullString, File1.List(i) , vbNullString, File1.Path, SW_SHOWNORMAL Next i End Sub