The following code works as an agent run from the actions menu after selecting docs to run it on. I am sure that someone with more knowledge of lotusscript than me (pascal?) can reduce this somewhat. I modified an existing example that I found so that it would do what you were after. Please test on dummy data before trusting this as I am a novice really when it comes to scripting.
Mark.
Sub Initialize
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uiDoc As NotesUIDocument
Dim db As NotesDatabase
Dim coll As NotesDocumentCollection
Dim doc As NotesDocument
Set db = s.CurrentDatabase
On Error Resume Next
Set uiDoc = ws.CurrentDocument
If Err <> 0 Then
Err = 0
Set uiDoc = Nothing
End If
If uiDoc Is Nothing Then
Set coll = db.UnprocessedDocuments
If coll.Count = 0 Then
Msgbox "Please choose a document to be processed!!", 16, "None Selected"
Exit Sub
End If
Set doc = coll.GetFirstDocument
Else
Set coll = Nothing
Set doc = uiDoc.Document
End If
While Not doc Is Nothing
Dim rtitem As Variant
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
Call rtitem.AddNewLine( 1 )
Call rtitem.AppendText("Time&Date Stamp:" )
Call rtitem.AppendText(Date$ )
' Call rtitem.AddNewLine( 1 )
Call rtitem.AppendText(" " )
Call rtitem.AppendText(Time$)
Call doc.Save( False, True )
End If
If coll Is Nothing Then
Set doc = Nothing
If uiDoc.EditMode Then Call uiDoc.Reload
If uiDoc.EditMode Then Call uiDoc.Refresh
Else
Set doc = coll.GetNextDocument(doc)
End If
Wend
End Sub