Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if file exists?

Status
Not open for further replies.

rainerforsthuber

Programmer
Nov 5, 2001
5
AT
how can I check if the file "1.bmp" exists? is it possible?
 
Function FileExists(FileName As String) As Boolean
On Error GoTo ErrorHandler
' get the attributes and ensure that it isn't a directory
FileExists = (GetAttr(FileName) And vbDirectory) = 0
ErrorHandler:
' if an error occurs, this function returns False
End Function
 
Or
--------------------------------------------------
if dir(&quot;c:\1.bmp&quot;)<>&quot;&quot; then msgbox &quot;file exist.&quot;
---------------------------------------------------

Sunaj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top