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?
Andy - 30 Mar 2005 17:11 GMT
The fix was easy. Last line was changed to:
projectStatus = projectStatus.insertBefore(richNode,
projectStatus.childNodes.Item(0))
> 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
[quoted text clipped - 13 lines]
> projectStatus is my richText field that ends up with the stampXML string
> appended to the end. Any suggestions?
Andy - 30 Mar 2005 17:11 GMT
The fix was easy, changed last line to:
> 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
[quoted text clipped - 13 lines]
> projectStatus is my richText field that ends up with the stampXML string
> appended to the end. Any suggestions?