Page 1 sur 1

Créer un répertoire

MessagePublié: 22 Juil 2005 à 18:05
par Michael DELIQUE
Code : Tout sélectionner
Function CreateDirectory(wPath As String) As Integer
   
   'Déclaration des Variables   
   Dim Directoty As String
   Dim i As Long
   Dim J As Long
   
   On Error Goto ErreurCreateDirectory
   
   If Trim(wPath)="'" Then
      Exit Function
   End If
   
   If Right(Trim(wPath),1)<>"\" Then
      wPath =Trim(wPath)+"\"
   End If
   
   On Error Resume Next
   
   i = 4
   J = 0
   While i <= Len(wPath)
      If Mid(wPAth,i,1)="\" Then
         Directoty= Left(wPath,i)
         Mkdir Directoty
         J=i
      Else
         j=j+1
      End If
      i=i+1
   Wend
   
   Exit Function
ErreurCreateDirectory:
   Msgbox "(CreateDirectory) Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Exit Function
   
End Function