Silly VB 2005 question.
deicist
Manchester, UK
Okay, I'm building a small app that will take a folder full of files and sort those files according to where the user wants to put them in a directory tree. Basiclaly the user will point the app at a folder and hit 'go' and for every files in that folder it will pop up a dialog with a directory tree on it for the user to either select a folder to put the file in, or create a new folder, or delete the file. Now, my problem is I want to display a directory tree that might not have a drive as it's root. For example if I have:
c:\archive\folders\folder1
c:\archive\folders\folder2
etc..
I want the root of the tree to be c:\archive\folders not c:\
I can do this by writing a function to recurse through the folders from the root and build my own tree but that's a little time intensive and I'd like to use a built in component if there is one. Anyone got any ideas?
c:\archive\folders\folder1
c:\archive\folders\folder2
etc..
I want the root of the tree to be c:\archive\folders not c:\
I can do this by writing a function to recurse through the folders from the root and build my own tree but that's a little time intensive and I'd like to use a built in component if there is one. Anyone got any ideas?
0
Comments
Cause in my opinion there are other languages that will code this more effiently.
In VB6 its easy to move a file: In what ever form or module:
Dim fso as New FileSystemObject
fso.MoveFolder "C:\Archive\Folders\Folder1", "C:\Archive\Folders\Folder2"
But that is VB6. Sorry I can't help with 2005, I sort of dropped Microsoft languages after VB6 and moved on to better things.
Just fyi: The File System Object component is neat, but its very limited. Limited in the fact, you can't read and write to a text file, you can't use wildcards for folders(and files in some cases), FileSystemObject allows creating ASCII or Unicode text files, FileSystemObject can read only ASCII text files. Although not much of this information is useful to ur problem, hence the fyi.
The other way i know of doing it is using the SHFileOperation API. I'm sure you know of this. So its just another way to move a folder. This API is way more useful than the FSO component. Unfortunatly these are VB6 things i know. I also know the VB6 code, w.o using components. Just straight code. But here we go, its VB6. Sorry I can't be more of a help.
Sorry prime i didnt mean it to sound like an attack, but I recieve flack about all my stuff on other forums. So when people post on the forum with the label of guru, or on others as "Master Programmer" or something and don't know what they are doing, I sorta critique their title. My Bad. Truly sorry. By no means is deicist not a guru in other respects of computers.
Incidently I'm a 'guru' because I actually read other people's posts and try and help them, rather than reading half the post and then replying with something completely irrelevant.
ctrl.InitDir = "c:\archive\folders"
ctrl.ShowOpen
if ctrl.FileName = "" Then
Else
End If
If thats not what u mean, im sure that:
ctrl.InitDir = "c:\archive\folders"
Would be helpful.
I think I might consider keeping VB6 and VB 2005 on computer. The syntax is different and i noticed on someone else computer that the menus are more of a nuisance to create. Well sorry I couldnt be of more help.