FileSystemObject.GetFolder Method (VB6)

Syntax

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.

Return Value

A Folder object.

Description

Returns a reference to a Folder object.

Rules at a Glance

  • 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.

Programming Tips and Gotchas

  • 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.

See Also

Folders.Item Property
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.101.8