Michael DELIQUE a écrit:oups
il faut ajouter cette fonction
- Code : Tout sélectionner
Public Function DirectoryIsValide(Byval wDirectory As String) As Boolean
Dim Directory As String
On Error Goto CatchError
If wDirectory = "" Then
DirectoryIsValide = False
Exit Function
End If
If Right(Trim(wDirectory),1)="\" Then
Directory = Left(Trim(wDirectory),Len(Trim(wDirectory))-1)
Else
Directory = Trim(wDirectory)
End If
On Error Resume Next
If Trim(Dir$ (Directory,16))="" Then
DirectoryIsValide = False
Else
DirectoryIsValide =True
End If
On Error Goto CatchError
%REM
Dim Directory As String
On Error Goto CatchError
If wDirectory = "" Then
DirectoryIsValide = False
Exit Function
End If
If Right(Trim(wDirectory),1)="\" Then
Directory = Left(Trim(wDirectory),Len(Trim(wDirectory))-1)
Else
Directory = Trim(wDirectory)
End If
If (Dir (Directory,16))="" Then
DirectoryIsValide = False
Else
DirectoryIsValide =True
End If
%END REM
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 !"
DirectoryIsValide = False
Exit Function
End Function
Ok, merci.
J'arrive à faire fonctionner le script, en démo il m'ouvre bien le dossier "TEMP".
Il reste juste un petit bug.
Quand je lcique pour la première fois sur le bouton, il m'ouvre bien le dossier "TEMP".
Par contre, si je tente de recliquer sur le bouton, il ne m'ouvre pas le dossier "TEMP", je ne comprend pas tout là !!
Comment est-ce possible ?
Merci
Cordialement