FileSystemObject.FolderExists Method (VB6)

Named Arguments

Yes

Syntax

oFileSysObj.FolderExists(FolderSpec)

oFileSysObj

Use: Required

Data Type: FileSystemObject object

Any object variable returning a FileSystemObject object.

FolderSpec

Use: Required

Data Type: String

The complete path to the folder.

Return Value

Boolean (True or False).

Description

Determines if a given folder exists.

Rules at a Glance

  • FolderSpec can't contain wildcard characters.

  • Returns True if the folder exists, False if not.

Programming Tips and Gotchas

If the user has adequate rights, FolderSpec can be a network path or share name. For example:

If ofs.FileExists("\\NTSERV1\d$\TestPath\") Then
						

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.