Connecting Tech Pros Worldwide Forums | Help | Site Map

subfolders and fso.GetFolder

Newbie
 
Join Date: Mar 2008
Posts: 4
#1: Mar 4 '08
Is there a property setting of some kind so that GetFolder will include all subfolders and files in the object folder?

I'm using VBScript. I hope this topic covers script. It looked like it did. Sorry if this is in the wrong place.

Moderator
 
Join Date: Oct 2006
Location: Australia
Posts: 7,748
#2: Mar 5 '08

re: subfolders and fso.GetFolder


Quote:

Originally Posted by bhavdahl

Is there a property setting of some kind so that GetFolder will include all subfolders and files in the object folder?

It does. Why, what's the problem?
Newbie
 
Join Date: Mar 2008
Posts: 4
#3: Mar 6 '08

re: subfolders and fso.GetFolder


Expand|Select|Wrap|Line Numbers
  1. strFrom1     = "C:\Documents and Settings\havdahbg\My Documents\"
  2.  
  3. Set objFromFolder = fso.GetFolder(strFrom1)
  4. For Each objFile In objFromFolder.Files 
  5.   fso.CopyFile objFile, objToFolder & "\"
  6. Next
  7.  
This just copies the files in the FromFolder and doesn't get any subfolders and files.
Moderator
 
Join Date: Oct 2006
Location: Australia
Posts: 7,748
#4: Mar 6 '08

re: subfolders and fso.GetFolder


Well, what do you expect to find in the Files collection? Try having a look at the SubFolders property. :)
Reply