PDA

View Full Version : How do you check checkboxs on web pages using wrappers?



antibinki
03-27-2007, 08:39 PM
How do you check checkboxs on web pages using wrappers?

rogeruk
05-15-2007, 03:37 PM
You can easily use clickat or create a clickcheckbox,


Private Sub ClickBullet(ByVal s As String)
Dim i As Long, Caption As String, HTMLElement
On Error GoTo Err_Init

For i = 1 To WebBrowser1.Document.All.length
Set HTMLElement = WebBrowser1.Document.All.Item(i)
If Not (HTMLElement Is Nothing) Then
If StrComp(HTMLElement.tagName, "INPUT", vbTextCompare) = 0 Then
If StrComp(HTMLElement.Type, "radio", vbTextCompare) = 0 Then
Caption = HTMLElement.Value
If (Caption Like s) Or (StrComp(Caption, s, vbTextCompare) = 0) Then
HTMLElement.Click
Exit For
End If
End If
End If
End If
Next i

Exit Sub
Err_Init:
MsgBox Err.Number & " - " & Err.Description, vbCritical
Resume Next
End Sub

Clicks a bullet point on a page :),