?
Solved

Search OuterText or OuterHTML

Posted on 2006-04-07
3
Medium Priority
?
243 Views
Last Modified: 2010-05-18
Using the browser control, sometimes a link renders error 404, page not found. I would like to know when this happens so as to respond accordingly. So, I ask you, Expert, what's the best way to search for the text "The page cannot be found"?

Many thanks in advance,
John
0
Comment
Question by:John Account
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
vinnyd79 earned 2000 total points
ID: 16405430
You can use instr :

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim strText As String
strText = WebBrowser1.Document.documentelement.outertext
If InStr(strText, "No page to display") > 0 Then
        MsgBox "No Page"
ElseIf InStr(strText, "The page cannot be displayed") > 0 Then
        MsgBox "No Page"
End If
End Sub
0
 

Author Comment

by:John Account
ID: 16405566
Thanks, vinnyd79.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question