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
Public Sub StartProcess(ByVal sFile As String, Optional ByVal sParameters As String = vbNullString)
ShellExecute 0&, "open", sFile, sParameters, vbNullString, 1&
End Sub
'
'
' =======
' EXEMPLE
' =======
'
Private Sub Form_Load()
StartProcess "C:\mon_image.jpg" '<- ouvre l'image avec ACDSEE par exemple
StartProcess "N:\Mon dossier" '<- ouvre l'explorateur à cette arborescence
StartProcess "D:\fichier.pdf" '<- ouvre le fichier avec Acrobat Reader
StartProcess "C:\Client.exe" '<- lance le programme
End Sub