Files and Folders

The VBA code fragments below are included in the Code-VB fragments library.
Fragments are snippets of code you can insert in your procedures.
Each item between braces correspond to a variable of the given type.
They are replaced with the new or existing variables by Fragment Builder in Code-VB tools.

File Exists

Len(Dir$({STRING:Filename})) > 0

Folder Exists

Len(Dir$({STRING:FolderName} ), vbDirectory) > 0

Get FileName from FullPath

{STRING:FileName} = Mid$({STRING:FullPath}, InStrRev({STRING:FullPath}, "\") + 1)

Get FolderName from FullPath

{STRING:FolderName} = Left({STRING:FullPath}, InStrRev({STRING:FullPath}, "\"))