Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2005

Tip: Looking for answers? Try searching our database.

Rich Text Box Manipulation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 16 Mar 2005 01:07 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.