*** post for FREE via your newsreader at post.newsfeed.c om ***
Hello,
I have trouble passing a folder object (from a FileSystemObjec t) to a sub
procedure.
Consider the following code:
=============== =============== ===
Private Sub Command1_Click( )
Dim FileSys
Set FileSys = CreateObject("S cripting.FileSy stemObject") 'Create a
FileSystemObjec t
Set ActiveFolder = FileSys.GetFold er("c:\temp\Ed_ test") 'Defines active
folder
PerformDisplay (FileSys.GetFol der("c:\temp\Ed _test"))
End Sub
Private Sub PerformDisplay( ChosenObjectFol der)
Set FileList = ChosenObjectFol der.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_tes t"
folder. It works fine. (Note that I'm not using the ActiveFolder object.)
If I replace the line:
PerformDisplay (FileSys.GetFol der("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: ChosenObjectFol der is merely a string (its value is:
"c:\temp\Ed_tes t" ) .
Question: how can I pass the object instead of the string?
Thank you very much!
John H. Dewbert
john_hdewbert@y ahoo.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! =-----
Hello,
I have trouble passing a folder object (from a FileSystemObjec t) to a sub
procedure.
Consider the following code:
=============== =============== ===
Private Sub Command1_Click( )
Dim FileSys
Set FileSys = CreateObject("S cripting.FileSy stemObject") 'Create a
FileSystemObjec t
Set ActiveFolder = FileSys.GetFold er("c:\temp\Ed_ test") 'Defines active
folder
PerformDisplay (FileSys.GetFol der("c:\temp\Ed _test"))
End Sub
Private Sub PerformDisplay( ChosenObjectFol der)
Set FileList = ChosenObjectFol der.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_tes t"
folder. It works fine. (Note that I'm not using the ActiveFolder object.)
If I replace the line:
PerformDisplay (FileSys.GetFol der("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: ChosenObjectFol der is merely a string (its value is:
"c:\temp\Ed_tes t" ) .
Question: how can I pass the object instead of the string?
Thank you very much!
John H. Dewbert
john_hdewbert@y ahoo.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! =-----
Comment