Extract body field

Dear All,

How can i extract a body field content via lotusscript in separate fields.

For example:

FirstName TEST1

Surname TESTxxx

Address Address1xxx

Countries GREECE

The values from the second column for each row starts from the same position.

I want to extract the above values from the second column to separate fields in a different form.

I would appreciate it if you could send a sample LS script.

Thanks in advance,

Nick

Subject: Extract body field

I created a form with only one Body field in it and a button.I pasted in this text:

FirstName + tab + TEST1 + newline

Surname + tab + TESTxxx + newline

Address + tab + Address1xxx + newline

Countries+ tab + GREECE

I saved the document.

Then I did what you should have done, read the help file.

In my button, I have this code:

Dim ws As New NotesUIWorkspace

Dim doc As NotesDocument

Dim rti As NotesRichTextItem

Dim rtnav As NotesRichTextNavigator

Dim rtrange As NotesRichTextRange

Dim iCount As Integer

Dim vSplit As Variant



Set doc = ws.CurrentDocument.Document 

Set rti = doc.GetFirstItem("Body")

Set rtnav = rti.CreateNavigator

Set rtrange = rti.CreateRange



If rtnav.FindFirstElement(RTELEM_TYPE_TEXTRUN) Then

	Do

		iCount = iCount + 1

		If iCount = 2 Then

			Call rtrange.SetBegin(rtnav)

			'-- We now have the 2nd line in our 'range'.

			'-- If the 'label' and the value are separated by a tab, all you need is to split.

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

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

		End If

	Loop While rtnav.FindNextElement(RTELEM_TYPE_TEXTRUN)

End If

This works with the text above. You will have to change the code to suit your particular needs.

Subject: RE: Extract body field

Thank you very much for your response.I check it and i reply