Goal: to use CKEditor in an Access2010 form in a CMS application.
Method: (1) Put a web browser control on an Access 2010 form. Set the control source to an HTML document loaded with CKEditor. (2) Inject HTML data from a memo field in an Access table into the CKeditor work area. (3) Edit the HTML data. (4) Return the edited HTML data back to the Access table.
Problem: stuck at (2) - can't inject the HTML data into the CKEditor work area. In Access VBA (with MS HTML Object Library loaded):
Dim HTML As HTMLDocument
Dim elc As HTMLHtmlElement
Dim strMyText as stringSet HTML = Me.MyWebBrowserControl.Object.Document
strMyText = Me.MyMemoFieldFor Each elc In HTML.all
If elc.isTextEdit = True Then
MsgBox ("Found an element that can edit text")
Debug.Print elc.getAttribute("name")
elc.innerText = strMyText
End If
Next
This finds "editor1", which looks like the work area, but elc.innertext = strMyText fails to inject any text into the work area. I suspect I may need to call javascript to do this, but would prefer to avoid it as I suspect things could rapidly get very messy in this context. Do I need the createTextRange method????
Help!!