Rich Text Box Manipulation

A

Andy

I am trying to ad a timestamp to a richtext field. While tis is a very easy
task to do in a normal text field by just doing basic function calls in
Infopath it is a bit more challenging as rich text box as it requires adding
some VB code. I have been successful in adding the timestamp to the end of
the field, but I need it to be inserted at the beginning of the field. Here
is the code snipet I am using that adds the stampXML at the end of the box:

Dim stampXML As String = "<div xmlns='http://www.w3.org/1999/xhtml'>
<br/>**********Status Updated as of: " & timeStamp & "<br/>" & "</div>"

Dim tempDoc As New MSXML2.DOMDocument50
tempDoc.loadXML(stampXML)
Dim richNode As IXMLDOMNode = tempDoc.documentElement.cloneNode(True)
projectStatus.appendChild(richNode)

projectStatus is my richText field that ends up with the stampXML string
appended to the end. Any suggestions?
 
A

Andy

The fix was easy. Last line was changed to:
projectStatus = projectStatus.insertBefore(richNode,
projectStatus.childNodes.Item(0))
 

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