使用vba更新网页上textarea中的文本

时间:2014-08-20 06:26:11

标签: vba excel-vba vbscript vb6 excel

请帮我写vba / vb6代码来更新富文本框

<textarea cols="60" rows="7" name="field_engagement_description[0][value]" 
id="edit-field-engagement-description-0-value" class="form-textarea"  
style="display: none;"></textarea>

我使用下面的代码同样不起作用

Set doc = IE.document

Set hcol = doc.getElementsByTagName("textarea")
For Each text In hcol
    If text.ID = "edit-field-engagement-description-0-value" Then
        text.Value = "NEW TEXT"
        Exit For
    End If
Next

1 个答案:

答案 0 :(得分:0)

Set doc = IE.document

doc.getElementById("edit-field-engagement-description-0-value").innerHTML = "New Text"