Yet another way to check if a file or folder exists

Category:
Files and Directories
Type:
Snippets
Difficulty:
Beginning
Author:
Brian M. Matumbura

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This function uses the Dir$ function to check the existance of a file or folder. Usage example: Dim bExists as Boolean bExists = PathExists("C:\Windows\Temp", True) ' Check for folder existance

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: