Hi,
I've searched quite extensively for the answer to this question but can't seem to find a solution, hopefully somebody can help me out.
I'm trying to fill in a form on a web page, but the form contains a text box that uses rich text. I can't find a way of filling in the text box. The rich text box does have a hidden field before it which it is associated with and I can use vba to fill this in but the validation on submitting the form fails because the rich text box is not complete.
I've included some snippets from the code below to try and give you the general idea of what I'm trying to do:
The vba code that I have at the moment:
Thanks for any help in advance
I've searched quite extensively for the answer to this question but can't seem to find a solution, hopefully somebody can help me out.
I'm trying to fill in a form on a web page, but the form contains a text box that uses rich text. I can't find a way of filling in the text box. The rich text box does have a hidden field before it which it is associated with and I can use vba to fill this in but the validation on submitting the form fails because the rich text box is not complete.
I've included some snippets from the code below to try and give you the general idea of what I'm trying to do:
HTML:
<textarea tabindex="3" name="description" cols="80" rows="10" style="visibility: hidden; display: none;"></textarea><div id="cke_description" class="cke_1 cke cke_reset cke_chrome cke_editor_description cke_ltr cke_browser_gecko" dir="ltr" role="application" aria-labelledby="cke_description_arialbl" lang="en"></div>
The vba code that I have at the moment:
Code:
Sub Vba2HtmlForm()
Dim ie As Object
Dim frm As Variant
Dim element As Variant
Dim wb As Workbook
Set wb = ThisWorkbook
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "web form"
While ie.readyState <> 4: DoEvents: Wend
Set frm = ie.document.getElementsByName("report_bug_form").Item(0)
Set evt = ie.document.createEvent("HTMLEvents")
ie.Visible = True
frm.elements("description").Value = "Description ......."
End Sub
Thanks for any help in advance