t***@gmail.com
2005-10-31 16:01:48 UTC
Doubtless this is a ridiculous newbie question in which case apologies
in advance.
I'm working from VBA in Microsoft Access and want to operate on a file
folder on the local computer. The NameSpace method creates and returns
a Folder object for the specified folder.
Looking at the Test procedure below, can someone explain to me why I
get "Nothing" back when I call NameSpace with a string variable, but I
get a Folder object back when I call NamesSpace with a string literal?
Private Sub Test()
Dim myApp As Object
Dim myFolder
Dim strTemp As String
strTemp = "c:\temp2"
Set myApp = CreateObject("Shell.Application")
Set myFolder = myApp.NameSpace(strTemp) ' returns Nothing
Set myFolder = myApp.NameSpace("c:\temp2") ' returns a Folder
object
End Sub
Thanks in advance.
in advance.
I'm working from VBA in Microsoft Access and want to operate on a file
folder on the local computer. The NameSpace method creates and returns
a Folder object for the specified folder.
Looking at the Test procedure below, can someone explain to me why I
get "Nothing" back when I call NameSpace with a string variable, but I
get a Folder object back when I call NamesSpace with a string literal?
Private Sub Test()
Dim myApp As Object
Dim myFolder
Dim strTemp As String
strTemp = "c:\temp2"
Set myApp = CreateObject("Shell.Application")
Set myFolder = myApp.NameSpace(strTemp) ' returns Nothing
Set myFolder = myApp.NameSpace("c:\temp2") ' returns a Folder
object
End Sub
Thanks in advance.