*** post for FREE via your newsreader at post.newsfeed.com ***
Hello,
I have trouble passing a folder object (from a FileSystemObject) to a sub
procedure.
Consider the following code:
=================================
Private Sub Command1_Click()
Dim FileSys
Set FileSys = CreateObject("Scripting.FileSystemObject") 'Create a
FileSystemObject
Set ActiveFolder = FileSys.GetFolder("c:\temp\Ed_test") 'Defines active
folder
PerformDisplay (FileSys.GetFolder("c:\temp\Ed_test"))
End Sub
Private Sub PerformDisplay(ChosenObjectFolder)
Set FileList = ChosenObjectFolder.Files ' Create a collection
For Each fil In FileList
MsgBox (fil)
Next fil
End Sub
================================
What it does is prompting all the files existing in the "C:\temp\Ed_test"
folder. It works fine. (Note that I'm not using the ActiveFolder object.)
If I replace the line:
PerformDisplay (FileSys.GetFolder("c:\temp\Ed_test"))
by the line:
PerformDisplay (ActiveFolder)
then it stops working... In the Command1_Click sub, ActiveFolder is an
object. However, what is passed to the PerformDisplay sub is not an object
anymore: ChosenObjectFolder is merely a string (its value is:
"c:\temp\Ed_test" ) .
Question: how can I pass the object instead of the string?
Thank you very much!
John H. Dewbert
jo***********@yahoo.ca
-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----