
03/11/2009, 14:16
|
| | Fecha de Ingreso: octubre-2009
Mensajes: 19
Antigüedad: 15 años, 6 meses Puntos: 1 | |
Respuesta: comp hacer una busqueda en el webbrowser Como saber si una palabra existe en una web page:
Private Sub Command1_Click()
Dim strfindword As String
strfindword = InputBox("Que Usted esta buscando?", "Buscar", "")
If WebPageContains(strfindword) = True Then
MsgBox "La Pagina contiene el texto buscado"
Else
MsgBox "La Pagina no contiene el texto buscado"
End If
End Sub
Private Function WebPageContains(ByVal s As String) As Boolean
Dim i As Long, EHTML
For i = 1 To WebBrowser1.Document.All.length
Set EHTML = _
WebBrowser1.Document.All.Item(i)
If Not (EHTML Is Nothing) Then
If InStr(1, EHTML.innerHTML, _
s, vbTextCompare) > 0 Then
WebPageContains = True
Exit Function
End If
End If
Next i
End Function
Private Sub Form_Load()
WebBrowser1.Navigate2 "aqui po la web que desea buscar"
End Sub |