' 경로를 만든다.
Public Function MakeDir(ByVal strpath As String) As Boolean
If strpath = "" Then Exit Function
strpath = Replace(strpath, "/", "\")
If Right(strpath, 1) = "\" Then strpath = Mid(strpath, 0, Len(strpath) - 1)
If Dir(strpath, vbDirectory) <> "" Then
MakeDir = True
Exit Function
End If
MakeDir = MakeDir(ExtractDir(strpath))
MkDir (strpath)
End Function
Public Function MakeDir(ByVal strpath As String) As Boolean
If strpath = "" Then Exit Function
strpath = Replace(strpath, "/", "\")
If Right(strpath, 1) = "\" Then strpath = Mid(strpath, 0, Len(strpath) - 1)
If Dir(strpath, vbDirectory) <> "" Then
MakeDir = True
Exit Function
End If
MakeDir = MakeDir(ExtractDir(strpath))
MkDir (strpath)
End Function
반응형