Checks and restore Directory Structure for a file to copy
Checks and restore Directory Structure for a file to copy
Rate Checks and restore Directory Structure for a file to copy
(1(1 Vote))
' Automatically Checks and Creates Directory Structure
' Parameters sFileName - Full File Path (eg. c:\aaa\ddd\aa.txt"
'
Public Sub CheckDirStructure(sFileName As String)
Dim iPosCurrent As Integer, iPosStart As Integer, s As String
iPosStart = 1
iPosCurrent = InStr(iPosStart, sFileName, "\")
Do Until iPosCurrent = 0
s = Left(sFileName, iPosCurrent)
If Dir(s, vbDirectory) = "" Then MkDir (s)
iPosStart = iPosCurrent + 1
iPosCurrent = InStr(iPosStart, sFileName, "\")
Loop
End Sub
Checks and restore Directory Structure for a file to copy Comments
No comments yet — be the first to post one!
Post a Comment