How do I expand a Treeview node to a specific folder/subfolder?
Hi everyone,
I have a tree-view object that is filled with a specific folder list, when a command button is pressed I would like too expand to a specific node based on a variable/foldername.
Does anyone know how to achieve this...
Hi MarkK,
I have managed to solve the Select Case problem edited code as follows...
Private Sub CreateNodes(Node1 As MSComctlLib.Node)
Dim fdParent As Scripting.folder
Dim fd As Scripting.folder
Dim fFile As Scripting.File
Dim Node2 As MSComctlLib.Node
Dim k As String
Dim...
Hi again MarkK,
Made a work around for now with on error 52.
Private Sub tvw_NodeClick(ByVal Node1 As MSComctlLib.Node)
Dim fso As New Scripting.FileSystemObject
Dim tClient As String
Dim tParent As Scripting.folder
Dim tFolder As Scripting.folder
Dim...
Hi MarkK
I have done some debugging,
If I place Before the Select Case Node1.Tag
msgbox Node1.key
It passes the value on any folder/File that is clicked but after it reaches the first case it just stops.
Do I have to define the Case in Select Case in anyway?
Hi Markk,
Thnx :-)
I m afraid I do not have a choice though, I had to change my career due to a back injury and programming was the only thing i Could do in my situation.
But I don't believe in quiting, it's not in my nature.
I previously had the form working perfectly using...
Hi again Markk
Ok I think i am seeing a little bit what you are pointing too :-)
I changed the Node1.Tag = "fd" to Node1.Tag = Node2 and placed a msgbox after it, now instead of "fd" in the msgbox I get the subfolder names as a message.
not sure if this is correct but I understand that it...
Hi Markk,
This what I have so far, but when i Click on the file or folder it does not do anything.
Private Sub CreateNodes(Node1 As MSComctlLib.Node)
Dim fdParent As Scripting.folder
Dim fd As Scripting.folder
Dim fFile As Scripting.File
Dim Node2 As MSComctlLib.Node
Dim k As...
Hi Markk
Sorry for my layman questions :)
What I mean is...
At the moment if I click on one of the folder's/subfolder in my treeview, I get the pictures in that folder's/subfolder to load into a form via an Array.
But when i come to click on one of the individual nodes in the treeview it...
Hi Mark,
Thank you for your reply.
Yea i noticed there was another function and I have all ready been busy with the code, so far this is what i have got.
Private Sub tvw_NodeClick(ByVal n1 As MSComctlLib.Node)
Dim fso As New Scripting.FileSystemObject
Dim tClient As String...
Hi eveyone,
I have been looking into populating a tree-view with folders and files, and have found some great examples for doing this, How ever...I cannot seem to work out how to show files/pictures in a form based on the click event of the tree-view.
I have managed to do an onclick event for...
Hi guys,
Thank you for your replies, both of which were good but I had tried those.
I have a solution which based on a variable shows the file as selected, here is the code in case anyone else has a similar issue.
Public Function ImageDblClickFunction(Ctrl As Control)
Dim Strg As String...
Hi again,
I have another issue that I cannot seem to find the answer to, maybe it's because I do not know how to phrase it correctly :banghead:.
I will try and explain it here..
What I want to do is... open a file dialog from VBA "This of cause is no problem"
the file dialog is opened from a...