Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21246

[RESOLVED] Click Button In WebBrowser Control Not Working

$
0
0
Here is the HTML:

Code:

<input type="image" value="Say It!" class="sayButton" name="SayButton" src="images/tts_oddcast_sayit.gif" onClick="DoAction(this.form.textToSay.value, this.form.effect.value);" />
Here is the code I have:

Code:

Dim Item As Variant
Dim strValue As String
Dim I As Long
For Each Item In Web1.Document.All
    I = I + 1
    strValue = ""
    On Error Resume Next
    strValue = Item.Name & Item.Value
    On Error GoTo 0
        If strValue = "SayButtonSay It!" Then
        strValue = ""
        Item.Click
    End If
Next

Now, I've placed that code in a command button. If I click it once, nothing happens. If I click it twice, it works. I'm baffled. Any ideas?

Viewing all articles
Browse latest Browse all 21246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>