Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with BeginInsert method to a richtext field

Status
Not open for further replies.

gromm

Programmer
Feb 21, 2003
12
PH
Hi!

I have 2 richtext fields: Remarks and RemarksLog.
The program is suppose to move contents of the Remarks field to the RemarksLog everytime the document is saved.
I used BeginInsert method to do this. The debugger found no error to it but it does not transfer the contents to the RemarksLog field.

Here is the code I used:

Code:
msgNote = uidoc.FieldGetText("remarks")
msg$ = Cstr (user + " (" + currDate + " " + currTime + ") - " + msgNote) '& Chr(13)
	
Set rtitem =  currDoc.GetFirstItem("remarksLog")
Set rtnav = rtitem.CreateNavigator	
nav = rtnav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH) 
If nav Then
	Call rtitem.BeginInsert(rtnav)
	Call rtitem.AddNewline(1)
	Call rtitem.AppendText("msg")
	Call rtitem.EndInsert
End If

	Call uidoc.FieldSetText("remarks","")
	Call currDoc.Save(False,True)

I'd truly appreciate your help. Thanks!
 
I believe you have to reload the doc to see the changes in RT fields.

Pascal.


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
When you mean "reload", it's closing and re-opening the document right? I did that but it still does the same thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top