
Originally Posted by
jdc2000
It seems too, weird think...
And big thank to you for helping me out here, I managed to get what I wish from the last link, but I can't figure out how to put new line after every new section.
Code:
Public Sub SaveTreeViewToFile(objTW As TreeView, stFilename As String)
Dim mNode As node
Dim mChild As node
Dim frFile As Integer
frFile = FreeFile
Open stFilename For Output As #frFile
For Each mNode In objTW.Nodes
If mNode.Children > 0 Then
Print #frFile, "[" & mNode.Text & "]"
For Each mChild In objTW.Nodes
If mChild.Children = 0 Then
If mChild.Parent.Key = mNode.Key Then
Print #frFile, "- " & mChild.Text
End If
End If
Next
End If
Next
Close #frFile
Exit Sub
End Sub