P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 10th, 2003 08:55 AM Post subject: Check if file exists, API way |
|
|
| Code: | Public Declare Function PathFileExists Lib "shlwapi.dll" _
Alias "PathFileExistsA" (ByVal pszPath As String) As Long
Public Function FileExists(strFileName As String) As Boolean
If PathFileExists(strFileName) = 1 Then
FileExists = True
Else
FileExists = False
End If
End Function
|
Usage :
| Code: | If FileExists("c:\test.txt") = False Then
Msgbox "File Does not Exist"
End If |
_________________ No one is completely useless. They can at least be an example of what to avoid. |
|