FileSystemObject.FileExists Method (VB6)

Named Arguments

Yes

Syntax

oFileSysObj.FileExists(FileSpec)


oFileSysObj

Use: Required

Data Type: FileSystemObject object

Any object variable returning a FileSystemObject object.


FileSpec

Use: Required

Data Type: String

A complete path to the file.

Return Value

Boolean (True or False).

Description

Determines if a given file exists.

Rules at a Glance

  • Returns True if the file exists or is connected to the machine, False if not.

  • FileSpec can't contain wildcard characters.

Programming Tips and Gotchas

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

If ofs.FileExists("\TestPathTest.txt") Then
						
						

..................Content has been hidden....................

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