par Michael DELIQUE » 31 Oct 2013 à 11:46
- Code : Tout sélectionner
Public Function DirectoryIsEmpty(Byval wPath As String) As Boolean
Dim PathFile As String
On Error Goto CatchError
If Trim(wPath) = "" Then
DirectoryIsEmpty = True
Exit Function
End If
If Right(Trim(wPath),1)="\" Then
PathFile = wPath
Else
PathFile = wPath+"\"
End If
If DirectoryIsValide(PathFile) = False Then
DirectoryIsEmpty = True
PathFile = ""
Exit Function
End If
PathFile = PathFile+"*.*"
If Trim(Dir$(PathFile)) = "" Then
DirectoryIsEmpty = True
Else
DirectoryIsEmpty = False
End If
PathFile = ""
Exit Function
CatchError:
MsgBox "("+Cstr(GetThreadInfo (1))+" Call by "+Cstr(GetThreadInfo(10))+")"+Chr(10)+"Error " + CStr(Err) + " : "+Chr(10) + CStr(Error)+". "+Chr(10)+"Line # "+Cstr(Erl),16," ERROR !"
DirectoryIsEmpty = False
Exit Function
End Function
Cordialement
Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN