You can't really write code that modifies itself in VB
. I've done it using assembly code and it's a nightmare anyway so you don't really want to go there.
What you should do is make a data structure that can hold the information so later you can open a program and read the information to figure out what to do about it. In this case, you can probably store the information for each tree view node in the node's Tag property. Each node is represented by a TreeNode object and that object's Tag property can hold anything you like. For example, the Tag property could hold a document name or another object that includes the document's name and any other information that you need.
When the user clicks on a node, you can get the Tag property and pull up the document.
The remaining issue is how do you store all of this. You could try using an XML file. They're hierarchical so they can store the information in a TreeView in a reasonably intuitive way. Or you could save the information in a plain text file and use indentation to show the TreeView's structure.
Here are some examples that may help:
I hope that helps.