Programatically format a richtext field. - InfoPath Dev
in

InfoPath Dev

Programatically format a richtext field.

Last post 09-29-2010 09:29 AM by vamirineni87. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-28-2010 02:18 PM

    Programatically format a richtext field.

    I am using Infopath 2003 with VBScript. I have a rich text field that I populate from an XML source.

    Currently when I load it using .text method, the html formatting tags show up, rather than the actual formatting.  

     

    I found a few tutorials online, but they didnot help.

     http://us.generation-nt.com/answer/how-set-rich-text-content-xhtml-control-using-vbscript-help-73846842.html

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

    reason it didnot work - infopath 2003 doesnot have innerchild/firstchild method in jscript or vbscript

     

    Is there way to format the rich text field with XHTML (using vbscript)?

    thanks in advance

  • 09-29-2010 09:29 AM In reply to

    Re: Programatically format a richtext field.

    I have figured it out.

    rather than first child, i referenced it with an array. (newbie mistakes :-) 

    node.appendChild(xmlRichText.firstChild)

    node.appendChild(xmlRichText.childnodes(0))

     

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.