PDA

View Full Version : Solved: Tree Nodes as links



kishlaya
02-11-2009, 11:19 PM
Hi
I have a treeview which represents certain data. i want to make each node of the tree a link to the corresponding data file it represents. is it possible by any means? :think:

Jan Karel Pieterse
02-12-2009, 12:12 AM
You can use the NodeClick event:

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Dim sTemp As String
sTemp = Node.Text
'Now use sTemp to pass as argument to your file opening routine.
End Sub

kishlaya
02-12-2009, 01:01 AM
Hi Jan
thanks for the prompt reply. actually my each node will be different link. is it possible to assign all of them to separate paths??
i have a sheet which populates the trees, is it possible if i make those values in sheets as hyperlinks and they are incorporated in my tree??
Thanks in advance

Jan Karel Pieterse
02-12-2009, 01:39 AM
If you put the entire link to the file in the node as the node's Tag property you could use this:

ThisWorkbook.followhyperlink Node.Tag
in the NodeClick event I showed you above.

kishlaya
02-12-2009, 02:07 AM
hi Jan
thanks for the code. i am not able to understand how should i add tag to it. can u please do it for 2 or 3 nodes and give any link like my documents or something, rest i can follow up. just for the first two numbers in the tree will do(in the attachment).
i am also attaching my file
Regards,
Kishlaya