Well, this problem has been bugging me the whole day, so I though maybe you experts could help me...

The idea is really simple: when you click cmdAdd, the contents of Text1 are added to TreeView1. It's supposed to receive a "path", delimited with "\" characters, and add nodes to the treeview according to them, much like in Windows Explorer.

My code is as follows:

Code:
Private Sub cmdAdd_Click()
    On Error Resume Next
    
    Dim TempArray() As String
    Dim TempStr As String
    Dim FolderFound As Boolean
    
    TempArray = Split(Text1.Text, "\")
    
    For i = 0 To UBound(TempArray) + 1
        TempStr = TempStr & TempArray(i) & "\"
        
        For j = 1 To TreeView1.Nodes.Count
            If TreeView1.Nodes(j).FullPath & "\" & TreeView1.Nodes(j).Text = TempStr & "\" Then
                FolderFound = True
                Exit For
            End If
        Next j
        
        If Not FolderFound Then
            TreeView1.Nodes.Add i + 1, tvwChild, , TempArray(i)
        End If
    Next i
End Sub
But it doesn't work!

I hope you can help me on this one.

Thanks for reading!

Bye,

-Jotaf98