Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All:
I would like to know if there is a simple and efficient way to create folders on a selcted drive (or location) based on the structure that is present in a Treeview. I basically have the Treeview created. The only thing the user has to do is select a drive (or location) and click a button that will create the folders with all the subfolders at the specified location. All the folder names have to be taken from the Treeview nodes. (text of the nodes) I was thinking of using the MkDir statement with recursive calls (probably recursion is the only way to get all nodes in a Treeview), but I am not sure if that is the correct or most efficient way. Any ideas/thoughts? Thanks Satish |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Satish,
<From API-Guide: http://www.allapi.net/ The MakeSureDirectoryPathExists function creates all the directories in the specified DirPath, beginning with the root. Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long Private Sub Form_Load() 'create the directory "c:\this\is\a\test\directory\", if it doesn't exist already MakeSureDirectoryPathExists "c:\this\is\a\test\directory\" End Sub </From API-Guide Although repeated calls to MkDir would work also. NickHK "Satish" wrote in message oups.com... Hi All: I would like to know if there is a simple and efficient way to create folders on a selcted drive (or location) based on the structure that is present in a Treeview. I basically have the Treeview created. The only thing the user has to do is select a drive (or location) and click a button that will create the folders with all the subfolders at the specified location. All the folder names have to be taken from the Treeview nodes. (text of the nodes) I was thinking of using the MkDir statement with recursive calls (probably recursion is the only way to get all nodes in a Treeview), but I am not sure if that is the correct or most efficient way. Any ideas/thoughts? Thanks Satish |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Awesome!
That solved my problem! It is definitely a much cleaner way than using the MkDir statement. Thanks a lot Nick! Satish :-) NickHK wrote: Satish, <From API-Guide: http://www.allapi.net/ The MakeSureDirectoryPathExists function creates all the directories in the specified DirPath, beginning with the root. Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long Private Sub Form_Load() 'create the directory "c:\this\is\a\test\directory\", if it doesn't exist already MakeSureDirectoryPathExists "c:\this\is\a\test\directory\" End Sub </From API-Guide Although repeated calls to MkDir would work also. NickHK "Satish" wrote in message oups.com... Hi All: I would like to know if there is a simple and efficient way to create folders on a selcted drive (or location) based on the structure that is present in a Treeview. I basically have the Treeview created. The only thing the user has to do is select a drive (or location) and click a button that will create the folders with all the subfolders at the specified location. All the folder names have to be taken from the Treeview nodes. (text of the nodes) I was thinking of using the MkDir statement with recursive calls (probably recursion is the only way to get all nodes in a Treeview), but I am not sure if that is the correct or most efficient way. Any ideas/thoughts? Thanks Satish |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
changing directories...with vba | Excel Programming | |||
sub directories again | Excel Programming | |||
sub directories again | Excel Programming | |||
sub directories | Excel Programming | |||
Directories | Excel Programming |