|
-
Jun 16th, 2000, 07:32 AM
#1
Thread Starter
New Member
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
-
Jun 16th, 2000, 07:58 AM
#2
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.
-
Jun 16th, 2000, 08:07 AM
#3
Thread Starter
New Member
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
-
Jun 16th, 2000, 08:28 AM
#4
Hyperactive Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|