I've been trying to generate a way to catch or suppress errors in my web browser control. actually what i really need in my browser is that if i run my project and the page cannot be display, to generate an error handler so instead of showing "The page cannot be display" to show something else, like "about:blank" for example or not display anything. i tried this:
Dim WithEvents objDoc As MSHTML.HTMLDocument Dim WithEvents objWind As MSHTML.HTMLWindow2 Dim objEvent As CEventObj Private Sub WebBrowser1_NavigateComplete() Set objDoc = WebBrowser1.Document Set objWind = objDoc.parentWindow End Sub Private Sub objWind_onerror(ByVal description As String, ByVal URL As String, ByVal line As Long) Set objEvent = objWind.event objEvent.returnValue = True MsgBox (description) End Sub
But i would like something diferent or better than this.
Any help will be appreciate.
Thanks in advance