by Brandon (46 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 16th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
open muliple files simulaneouly
'make sure both of these files or directories exist
Private Sub Form_Load()
'open multiple files simulaneously
On Error Goto Trouble:
Dim FileArray(1 To 2) As String
Dim r As Double
Dim i As Integer
'store files in array
FileArray(1) = "notepad.exe"
FileArray(2) = "explorer " & "C:\MSOffice\Office"
For i = 1 To 2
r = Shell(FileArray(i), vbNormalFocus)
Next i
Trouble:
Msgbox Err.Description
End Sub