Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Nested directories from Treeview

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Nested directories from Treeview

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Nested directories from Treeview

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing directories...with vba mjschukas Excel Programming 3 June 6th 04 10:01 PM
sub directories again Shailesh Shah[_2_] Excel Programming 5 February 9th 04 09:32 PM
sub directories again Mike[_67_] Excel Programming 2 February 7th 04 12:06 AM
sub directories Mike Excel Programming 5 February 6th 04 10:15 PM
Directories Jeff[_24_] Excel Programming 4 January 20th 04 09:26 AM


All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"