Hi All,
We have moved website and I was trying to write a VBA macro to automatically fill the new site with the old site's contents. I can populate the normal text fields; however I can't populate the 'main' box which let's you write HTML text.
I can't seem to reference it and add a value - it appears the text area contains an iframe which converts any typed text into HTML and that get's loaded into the box. It would be of great help if I could also fill it. This is the HTML surrounding the box:
The code I have current:
Thanks very much! Also any alternative ideas about this (e.g. submit POST request?) much appreciated
We have moved website and I was trying to write a VBA macro to automatically fill the new site with the old site's contents. I can populate the normal text fields; however I can't populate the 'main' box which let's you write HTML text.
I can't seem to reference it and add a value - it appears the text area contains an iframe which converts any typed text into HTML and that get's loaded into the box. It would be of great help if I could also fill it. This is the HTML surrounding the box:
Code:
******** tabindex="0" title="Rich Text Editor, field_id_14, Press ALT 0 for help" class="cke_wysiwyg_frame cke_reset" aria-describedby="cke_37" src="javascript:void(function(){document.open()%3B(function()%7Bfor(var%20a%3B%3B)try%7Ba%3Dwindow.parent.document.domain%3Bbreak%7Dcatch(e)%7Ba%3Da%3Fa.replace(%2F.%2B%3F(%3F%3A%5C.%7C%24)%2F%2C%22%22)%3Adocument.domain%3Bif(!a)break%3Bdocument.domain%3Da%7Dreturn!!a%7D)()%3Bdocument.close()%3B}())" frameborder="0" style="width: 100%; height: 100%;" allowtransparency="true">*********>
The code I have current:
Code:
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate ("http://cra.treatdigital.com/admin.php?/cp/content_publish/entry_form&channel_id=7&S=aa0421849b1c522426223cf0459cde3e")
While ie.readyState <> 4
DoEvents
Wend
ie.document.getElementById("username").Value = "xx"
ie.document.getElementById("password").Value = "yy"
Sleep 1000
Set els = ie.document.getElementsByTagName("input")
For Each el In els
If el.Value = "Login" Then el.Click
Next el
Sleep 1000
'ie.document.getElementById("cke_1_contents").getElementsByTagName("iframe")(0).Value = "TEST"
Set els = ie.document.getElementsByClassName("holder")
For Each el In els
Debug.Print el.uniqueID
Select Case el.uniqueID
Case "ms__id3"
el.Children(0).Value = "test_title_cell2"
Case "ms__id4"
el.Children(0).Value = "test_url_cell2"
'Big INPUT
Case "ms__id5"
Debug.Print el
Case "ms__id6"
el.Children(0).Value = "02/01/01 2:34 PM"
End Select
Next el
Sleep 1000
ie.document.getElementById("submit_button").Click
Thanks very much! Also any alternative ideas about this (e.g. submit POST request?) much appreciated