Need to keep the last 30 lines of a rich text field

Hi all,

How could I keep only that last 30 lines of a rich text field.

The field contains like a history of event.

bob 12 March …

john 13 march did that…

sue 14 march did this too…

thanks

Paul,

Subject: Need to keep the last 30 lines of a rich text field

If your rich text field entries are seperated with a new line character then they are stored internally in notes as a carriage return and line feed - Chr(13) then Chr(10).

To find the last 30 entries in the current document

Dim ws As New notesuiworkspace

Dim uidoc As notesuidocument

Dim rtitem As NotesRichTextItem

Dim doc As notesdocument

Dim text As String

Set uidoc = ws.currentdocument

Set doc = uidoc.Document

Set rtitem = doc.GetFirstItem(“RTFIELD”)

'Note that if there are less than 30 entries in the field then text

'will be an empty string

text = Strrightback(rtitem.Text, Chr(10), 5, 30)

msgbox text