Split content of a Body field

Dear All,

Top URGENT

Somebody help me!!

In my mailbox i receive documents which the body field has the following value:

Content-Transfer-Encoding: 7bit

Content-Type: text/plain; charset=iso-8859-7

Content-Language: en, el

hiddenField access

ReferenceNum 753800

Title Mr

FirstName NICK

Surname BORDER

Countries Greece

communication post

HomeAddress HOME 342

PostalCode 12121

City ATHENS

Phone 2109655558

Email TEST@TEST.XXX

Times 08:00-12:00

Interest Cards

HSBC_Customer No

HSBC_Premier No

Find Select…

Question Indication

Comments COMMENTS

NOTICE:

The rows below are visibled only from the document’s properties

Content-Transfer-Encoding: 7bit

Content-Type: text/plain; charset=iso-8859-7

Content-Language: en, el

I have created an agent that splits the values for each row of a body field and displays them in messageboxes.

Here is the agent that i use:

Sub Initialize

Dim session As NotesSession

Dim db As NotesDatabase

Dim dc As NotesDocumentCollection

Dim doc As NotesDocument

Dim rti As NotesRichTextItem

Dim rtnav As NotesRichTextNavigator



Set session = New NotesSession

Set db = session.CurrentDatabase

Set dc = db.UnprocessedDocuments

Set doc = dc.GetFirstDocument



If dc.Count = 0 Then

	Messagebox "Nothing selected",, "No documents"

	Exit Sub		

End If



Set rti = doc.GetFirstItem("Body")

Set rtnav = rti.CreateNavigator	

Set rtrange = rti.CreateRange



If rtnav.FindFirstElement(RTELEM_TYPE_TEXTRUN) Then

	Do

		iCount = iCount + 1

		

		Call rtrange.SetBegin(rtnav)

		

		vSplit = Split(rtrange.TextRun, Chr(9))

		

		If icount = 1 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 2 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 3 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 4 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 5 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 6 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 7 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		Elseif icount = 8 Then

			Msgbox "The text is: " & vSplit(Ubound(vSplit))

		End If

		

	Loop While rtnav.FindNextElement(RTELEM_TYPE_TEXTRUN)

	

End If

End Sub

The problem is that the messagebox displays only the first row for new mails.(like hiddenField access)

But if i copy the body content from the document properties and paste it in a new document the agent works fine.

I would appreciate it if you could reply my.

Regards,

Nick