-
Please help!
Sorry to bother you again with these simply little questions but i'm only just learning and need help.
First
How can you check to see if a file is there before atempting to open it
and Second
How can you ue the MsgBox and what the uses clicks eg Cancel or OK
Thank you for your help
Tingin47
-
To check if a file exists:
Code:
Public Function fileexists(strfilepathandname As String) As Boolean
On Error Resume Next
Dim lngcheck As Long
If InStr(strfilepathandname$, ".") = 0& Then
Let fileexists = False
End If
Let lngcheck& = Len(Dir$(strfilepathandname$))
If lngcheck& = 0& Then
Let fileexists = False
Exit Function
Else
Let fileexists = True
End If
Exit Function
End Function
Usage:
If fileexists("C:\file.exe") Then...
And for the Message box code, look in your vb help file under MsgBox constants and Msgbox function.
-
Need Help Still
Please van someone post the stuff about the MSGBox functions because i'm doing research from home but VB at school so i can't access it at the moment
-
Msgbox info
You can go to the MSDN library on line. Just type in MSGBOX in your web browser search engine (msn.com) and you're in!