TreeView

E

Ed

There is a tree view tool that I have recently discovered. Cool tool, but I
cannot get it to display the name of the file in a sub-folder. It only shows
a number (the same number) instead of the various documents. The number is
"1291208" and that number is used in place of each of the files. Here is a
representation of what I see when the tree view displays:

+Your Docs
-My Docs
|
---> 1291208
---> 1291208
---> 1291208
+His Docs
+Her Docs

When I step through the code, I know that the value is being picked up.
And when I click on one of the child nodes, I can "see" that behind the node
is the proper file name. What am I doing wrong?

Here is the code which I use to fill in the child node values.
"DirArray()" contains the first level of sub-directory folders. FilesAre()
are the documents in the sub-folder. When I hover over "Text" (the last line
of the For...Next loop) as I step through the module run, I can see that the
proper value has been assigned. (GetFolderList is a routine that reads each
file in a subfolder beneath the 'topfolder' called SAP into "longlist".)

With Me.TreeView1.Nodes
.Clear
For n = 1 To UBound(DirArray)
.Add Key:=DirArray(n), Text:=DirArray(n)
longlist = GetFolderList(SAP & DirArray(n))
filesare = Split(longlist, "&")
For ln = 0 To UBound(filesare)
.Add relative:=DirArray(n), _
relationship:=tvwChild, _
Key:=DirArray(n) & "," & filesare(ln), _
Text:=filesare(ln)
Next
Next
End With

--Ed (in Virginia)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top