Have an application where I simply append rich text from an rtf field in another document. But in so doing, the agent works fine, but the rtf attributes in the target field become frozen and can’t later be changed. (e.g. put the document in edit mode, you can’t change the font, size, or any attributes like bold, italic, etc.)
Here’s the simple agent:
Sub Initialize
Dim session As New notessession
Set db = session.currentdatabase
Dim datetime As New NotesDateTime("today")
Set dc = db.Search({ Form = "Engineer Note" & @IsResponseDoc & ProcessFlag != "1"} ,Nothing,0)
Set responsedoc = dc.GetFirstDocument
While Not responsedoc Is Nothing
unid = responsedoc.parentdocumentunid
Set parentdoc = db.getdocumentbyunid(unid)
Set rtitemA = parentdoc.GetFirstItem( "Eng_Notes" )
Set rtitemB = responsedoc.GetFirstItem( "Body" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
Dim rtpStyle As NotesRichTextParagraphStyle
Set rtpStyle = session.CreateRichTextParagraphStyle
rtpStyle.FirstLineLeftMargin = RULER_ONE_INCH * .50
rtpStyle.LeftMargin = RULER_ONE_INCH * .50
Call rtitemA.AppendParagraphStyle(rtpStyle)
author = Evaluate("@name([cn]; author)", responsedoc)
Call rtitemA.appendtext(datetime.LocalTime + " - " + author(0))
Call rtitemA.AppendParagraphStyle(rtpStyle)
Call rtitemB.AppendParagraphStyle(rtpStyle)
Call rtitemA.AppendRTItem( rtitemB )
parentdoc.Save False, False
End If
responsedoc.processflag = "1"
responsedoc.save False, False
'Set lastresp = responsedoc
Set responsedoc = dc.GetNextDocument(responsedoc)
'Call lastresp.remove(True)
Wend
End Sub
Any Ideas?