1 2 3 4 5 6 7 8
| Declare Function SearchPath Lib "kernel32" Alias "SearchPathA" (ByVal lpPath As String, ByVal lpFileName As String, ByVal lpExtension As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long
Function existeFileSearchPath(ByVal chemin, fichier As String) As Boolean
'Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Dim ResultFileName As String
Dim pFilePart As Long
existeFileSearchPath = SearchPath(chemin, fichier, vbNullString, 1, ResultFileName, pFilePart) > 0
End Function |
Partager