1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Private Declare Function ShellExecute _
Lib "shell32.dll" _
Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpszOp As String, _
ByVal lpszFile As String, _
ByVal lpszParams As String, _
ByVal lpszDir As String, _
ByVal FsShowCmd As Long) As Long
Private Declare Function FindWindow _
Lib "user32" _
Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Sub CommandButton1_Click()
Dim Fichier As String
'adapter le chemin et nom du fichier
Fichier = "D:\Dossier 1\Dossier 2\Mon fichier d'aide.doc ou .pdf"
ShellExecute FindWindow(vbNullString, Application.Caption), _
"open", Fichier, vbNullString, vbNullString, 1
End Sub |
Partager