Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect Browse results with InternetExplorer object 1

Status
Not open for further replies.

ErroR

Technical User
Apr 9, 2001
79
US
Using the IE object, I've got the browsing down with VB. I would like to detect if the browse resulted in a 404 - File Not Found result, in case the URL that was determined by my VB App is invalid.

I'm able to use the DownloadComplete and NavigateComplete events, so I'm wondering if there is some type of event to interpret the error status of the navigate?
 

I believe you can use the WB.ReadyState to check it for various states = (200 = OK), (404 = FNF), (500 = Server Error) etc.

Also I use the ProgressChange, DocumentComplete, TitleChange, and StatusTextChange events for tracking my progress and status. I wait on these events in code in a do while Wait = False, doevents loop where Wait is a boolean variable I set to false prior to entering the loop and set it to true in the DocumentComplete event.

I hope this helps, Good Luck

 
The ReadyState would seem to be what I needed, but it has limited return codes, and you get the same return code regardless if the browser results are 200 or 404. The other suggestions you made are helpful in other ways, but for this particular function, I need those return codes.

ReadyState Info:

The functionality I seem to need lies within the event "NavigateError" which appears to be new with IE 6.


Unfortunately, some of my clients are still on IE 5.5 so I need this to be reverse compatible with that browser. I can't imagine that nothing exists to return the navigation results in the pre IE6.0 browsers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top