Results 1 to 2 of 2

Thread: Detect if the page isn't found

  1. #1

    Thread Starter
    Hyperactive Member Matt-D's Avatar
    Join Date
    Nov 1999
    Location
    Mettmann, Germany
    Posts
    305

    Question

    There's a list with internet-addresses.
    My program starts a browser (as many times as there are items
    in the listbox) and opens all the adresses
    from this list.

    But it could be that the page isn't found on this server / adress and
    theres's an (internet) error 404.
    Is it possine, that my programm closes all the Browser-windows
    in which the internet error 404 occured ?
    When there's
    no error the page should load normal.


    Matt


  2. #2
    Fanatic Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    554
    Code:
    Option Explicit
    
    Private Sub Form_Load()
        'the file your navigating to from your list
        WebBrowser1.Navigate App.Path & "\test.htm"
        DoEvents
    End Sub
    
    Private Sub Timer1_Timer()
    
    Static Toggle As Boolean
    
        If Not Toggle Then
            buf = WebBrowser1.Document.Title
            If buf <> "" Then
                Me.Caption = buf
                buf = LCase(buf)
                If InStr(buf, "cannot find server") <> 0 Then End
            End If
        End If
        
    End Sub
    this works, but you need to tidy up the closedown of the window, as i've just put end, but you may wish to relase resources etc.

    DocZaf
    {;->

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