How to set rich text content in xhtml in control using vbscript

D

dj

Hi All,
I am a newbee in infopath. I am not able to set rich text content (which is
XHTML) using VBScript code. I want do something like
XDocument.DOM.documentElement.SelectSingleNode("/my:myFields/my:myRichText")
--> Feed this control's to XHTML something like
<div xmlns="http://www.w3.org/1999/xhtml">My rich text here</div>

I know C#/VB code is there but my limited knowledge I cant translate it into
vbscript.

Any help is highly appreciated.
Thanks !
dj
 
D

dj

Thanks very much for your reply. Now it works for me ..here is the code:


xhtml= "<myns xmlns="+ chr(34)+ "http://www.w3.org/1999/xhtml"+chr(34)+">"
+xhtml + "</myns>"
'XDocument.UI.Alert(xhtml)
set xmlRichText=CreateObject("MSXML2.DOMDocument.5.0")
xmlRichText.async="false"
xmlRichText.loadXML(xhtml)
'XDocument.UI.Alert(xmlRichText.xml)
Set node=
XDocument.DOM.documentElement.SelectSingleNode("/my:myFields/my:myRichText")
node.appendChild(xmlRichText.firstChild)

Trick is to wrap xhtml in a ns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top