I have a text box,a dir and a drive on my form and
i would like to know if someone have a little function to
check if the path entered in the text box is valid,if not ask the user to create it and if he say yes:the dir should be on the new folder???
Printable View
I have a text box,a dir and a drive on my form and
i would like to know if someone have a little function to
check if the path entered in the text box is valid,if not ask the user to create it and if he say yes:the dir should be on the new folder???
Code:
---------------------------
If Dir(Trim(Text1.Text),vbDirectory)="" Then
If MsgBox("The directory does not exist. Do you want to create it?",vbYesNo+vbQuestion,"")=vbYes Then
MkDir Trim(Text1.Text)
End If
End If
--------------------------
Visual Basic Professional 6.0