I have problem here. How I can create working directory?
I have textbox show this D:\Project\Data.. How I can create folder for this location?
Printable View
I have problem here. How I can create working directory?
I have textbox show this D:\Project\Data.. How I can create folder for this location?
Code:Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" _
(ByVal lpPath As String) As Long
Private Sub Command1_Click()
'the will create the directory "d:\project\data"
'if it doesn't already exist
MakeSureDirectoryPathExists "d:\project\data\"
End Sub
How If the folder already exist.. How I can tell the user?
Code:If Dir$("d:\project\data", vbDirectory) <> vbNullString Then
MsgBox "The Project\Data folder already exists.", vbOKOnly + vbInformation,"No Need To Create"
Else
MakeSureDirectoryPathExists "d:\project\data\"
MsgBox "The Project\Data folder has been created on your D: drive.", vbOKOnly + vbInformation, "Folder Created Successfully"
End If