Private Sub Command1_Click ()
'Se non e' presente la barra '\' alla fine 'la aggiungo If Right$(Text1, 1) <> "\" Then Text1 = Text1 & "\" 'Controllo se la directory inserita esiste If Dir$(Text1 & ".", vbDirectory) <> "" Then MsgBox "Directory already exist !", vbCritical Text1.SelStart = 0 Text1.SelLength = Len(Text1) Text1.SetFocus Else Dim i As Integer For i = 1 To Len(Text1) If Mid$(Text1, i, 1) = "\" Then If Dir$(Left$(Text1, i) & ".") = "" Then MkDir Left$(Text1, i) End If End If Next i End If End Sub '****************************************************** 'Fine procedura. '****************************************************** inserire in un form una textbox 'text1' e un command button 'command1' e scrivere nell'evento click del command button |