FileSystemObject.GetFolder Method (VB6) |
oFileSysObj.GetFolder(FolderPath)
oFileSysObj
Use: Required
Data Type: FileSystemObject object
Any object variable returning a FileSystemObject object.
FolderPath
Use: Required
Data Type: String
A path to the required folder.
A Folder object.
Returns a reference to a Folder object.
FolderPath can be an absolute or relative path.
If FolderPath is a share name or network path, GetFolder ensures that the drive or share exists as part of the process of creating the Folder object.
If any part of path can't be contacted or doesn't exist, an error occurs.
You should first use GetAbsolutePathName to create the required path string.
If FolderPath includes a network drive or share, you could use the DriveExists method to confirm the required drive is available prior to calling the GetFolder method.
Since GetFolder requires that FolderPath is the path to a valid folder, you should call the FolderExists method to verify that FolderPath exists.
You must use the Set statement to assign the Folder object reference to a local object variable.