A Quick Way to Extract Filenames From a Path

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

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
Sample usage: FilenameFromPath "C:\Windows\install.log" returns "install.log"; FilenameFromPath "\\server\shared\calendar.doc" returns "calendar.doc"; FilenameFromPath "music.download.part" returns "music.download.part"

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

Declarations:

Code: