1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Option Compare Database
Option Explicit
#If VBA7 Then
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal Hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
#Else
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
#End If
Public Sub Ouvrir_fichier(Chemin As String)
'Ouvrir, avec le pgm associé, le fichier dont le chemin est passé en paramètre
ShellExecute Application.hWndAccessApp, "open", Chemin, "", "", 1
End Sub |
Partager