Results 1 to 4 of 4

Thread: Need Help reguarding MsgBox and File info

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Australia
    Posts
    7

    Arrow

    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

  2. #2
    Guest
    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Australia
    Posts
    7

    Arrow 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

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360

    Post 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
  •  



Click Here to Expand Forum to Full Width