Get a list of file names, given a directory name or a directory wild card string

Category:
Files and Directories
Type:
Snippets
Difficulty:
Beginning
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic 6

More information:
This function takes a directory name or a file/directory mask string (e.g., "C:\*.txt") and returns a string array containing all the files in the directory or meeting the criteria.

The function returns an array, which can only be done in VB6 or higher. If you want to use this in a earlier version of VB, change the return type to variant.

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

Declarations:

Code: