CreateFullTree

Creates full tree if not found

Sub CreateFullTree(Tree)
 ' Needs Isthere(),
 Dim Look As String, InFolder As String
 For i = 1 To Len(Tree)
  If Mid(Tree, i, 1) = "\" Then
   fo = i
   InFolder = Left(Tree, i)
   For j = i + 1 To Len(Tree)
    If Mid(Tree, j, 1) = "\" Then
     Look = Mid(Tree, i + 1, j - i - 1)
     If Not IsThere(Look, InFolder, , , True) Then
      MkDir InFolder & "\" & Look
     End If
     Exit For
    End If
   Next j
  End If
 Next i
 InFolder = Left(Tree, fo)
 Look = Mid(Tree, fo + 1)
 If Not IsThere(Look, InFolder, , , True) Then
  MkDir InFolder & "\" & Look
 End If
End Sub

Views 550 Downloads 147

'IsThere', 'Tree', 'Folder', 'Folders', 'Create', 'Dir'

ANmarAmdeen
324
File System VBA
Revisions

v1.0

Needs