Dim i As Integer Dim vDoc As Object Dim vTag As Object Set vDoc = WebBrowser1.Document For i = 0 To vDoc.All.length - 1 If UCase(vDoc.All(i).tagName) = "TEXTAREA" Then Debug.Print vDoc.All(i).Type Set vTag = vDoc.All(i) If vTag.Type = "textarea" Then Select Case vTag.Name Case "message" vTag.Value = "************" End Select End If End If Next i这样都无法搞定~!!!纳闷了。
Dim vDoc As Object
Dim vTag As Object
Set vDoc = WebBrowser1.Document
For i = 0 To vDoc.All.length - 1
If UCase(vDoc.All(i).tagName) = "TEXTAREA" Then
Debug.Print vDoc.All(i).Type
Set vTag = vDoc.All(i)
If vTag.Type = "textarea" Then
Select Case vTag.Name
Case "message"
vTag.Value = "************"
End Select
End If
End If
Next i这样都无法搞定~!!!纳闷了。
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim oDoc As HTMLDocument
Set oDoc = pDisp.Document
Dim oTxt As HTMLTextAreaElement
Set oTxt = oDoc.getElementById("e_textarea")
If oTxt Is Nothing Then Exit Sub
oDoc.parentWindow.execScript "writeEditorContents(""hello world!"");"
End Sub