Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Function FileExist(Fichier As String) As Boolean Dim a As Long On Error Resume Next a = FileLen(Fichier) TesterPresenceFichier = Not (Err.Number > 0) On Error GoTo 0 End Function
OFile = App.Path & "\FichierText.txt" Open OFile For Input As 1 'ouvre le fichier Do While Not EOF(1) 'End Of File (numero du fichier) Input #1, TextFile 'met le contenu du fichier dans TextFile Loop Close #1 'ferme le fichier
Private Type FILETIME dwLowDate As Long dwHighDate As Long End Type Private Type WIN32_FIND_DATA dwFileAttributes As Long ftCreationTime As FILETIME ftLastAccessTime As FILETIME ftLastWriteTime As FILETIME nFileSizeHigh As Long nFileSizeLow As Long dwReserved0 As Long dwReserved1 As Long cFileName As String * 260 cAlternate As String * 14 End Type Private Declare Function FindFirstFile Lib "kernel32" _ Alias "FindFirstFileA" _ (ByVal lpFileName As String, _ lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function FindClose Lib "kernel32" _ (ByVal hfile As Long) As Long Private Function FileExist(ByVal nom) As Boolean Dim FindData As WIN32_FIND_DATA Dim hfind As Long hfind = FindFirstFile(nom, FindData) If hfind <> -1 Then FileExist = True FindClose hfind End Function