Seems as though you have Notes background. Here is the agent code from the Advantage DB in case you can give it a quick look over...
Sub Initialize
Dim session As New NotesSession
Dim view As NotesView
Dim newresponse As notesdocument
Dim db As notesdatabase
Set db = session.CurrentDatabase
Dim doc As notesdocument
Dim doc2 As notesdocument
Dim nextDoc As NotesDocument
Dim notesDocumentCollection As notesDocumentCollection
Dim dc As notesdocumentcollection
Dim emailbody As String
Dim temp, temp2 , temp3 As String
Dim i As Integer
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Do
Set nextDoc = dc.GetNextDocument(doc)
i =0
If (doc.processed(0) = "" Or doc.processed(0)=Null Or doc.processed(0)="no") And doc.From(0)="ADVANTAGE@attotech.sites.net" Then
' Messagebox "value=" +doc.Body, 0, "STOP"
emailbody=doc.Body
'Parse Body Field from New Mail and input into respective Notes Fields
temp = Strtoken(emailbody, Chr(13),0)
' Messagebox "value=" +temp , 0, "STOP"
temp2 = Strtoken(temp,": ",0)
temp3 = Strtoken(temp,": ",2)
Set doc2 = New NotesDocument( db )
doc2.Form="AdvantageApp"
Do
i=i+1
If (temp<>Null) Or temp <> "" Then
' Messagebox "value=" +temp3 , 0, "STOP"
' Messagebox "value=" +Strtoken(temp,": ",2) , 0, "STOP"
Select Case temp2
Case "Company_Name" : doc2.cname=temp3
Case "Address" : Case "employeebreakdown.servicesupport" : doc2.servicesupport=temp3
Case "employeebreakdown.systemengineers" : doc2.systemengineers=temp3
Case "primarybusiness" : doc2.cbusiness=temp3
Case "yearestablished" : doc2.cyear=temp3
Case "customerreferenceaccounts" : doc2.reference=temp3
Case "inventoryofspareparts" : doc2.inventory=temp3
Case "explain" : doc2.explain=temp3
Case "notes" : doc2.notes=temp3
End Select
End If
emailbody=Strright(emailbody,Chr(10)) 'Process rest of paragraph minus previous line
' Messagebox "Body is. " +emailbody, 0, "STOP"
temp = Strtoken(emailbody, Chr(13),0)
' Messagebox "left of body is =" +Strleft(emailbody, Chr(12)) , 0, "STOP"
' Messagebox "value=" +temp , 0, "STOP"
' Messagebox "value=" +Strtoken(temp,": ",1) , 0, "STOP"
' Messagebox "value=" +Strtoken(temp,": ",2) , 0, "STOP"
If Len(temp)<1 Then
'previous was a blank line process next line
emailbody=Strright(emailbody,Chr(10))
temp = Strtoken(emailbody, Chr(10),0)
End If
' Messagebox "value=" +temp , 0, "STOP"
temp2 = Strtoken(temp,": ",0)
' Messagebox "value=" +temp2 , 0, "STOP"
temp3 = Strtoken(temp,": ",2)
'find the value between the 2 colons. This will give us user input
Dim content, backup As String
content = Strright(emailbody,": ")
backup = content
content = Strleft(content,":")
content = Strleft(content,(Chr(13)+Chr(10)+Chr(13)+Chr(10))) 'Go up 2 lines
'if there are 2 endlines in a row then it is a blank line
If Len(Strleft(content,(Chr(13)+Chr(10)+Chr(13)))) > 1 Then
temp3 = Strtoken(temp,": ",2)
temp3=content
Else
'Check again if this is the last token
If Len(content) <1 Then
Else
temp3 = Strleftback(Strtoken(temp,": ",2),Chr(13))
temp3=content
End If
End If
' If temp2="howattofits" Then
' Messagebox "value of TEMP2= " +Strtoken(temp,": ",2) , 0, "STOP"
' End If
' temp3=content
' temp3 = Strleftback(temp3,Chr(13))
newemailbody = Strright(emailbody,Chr(13)) 'uncommented this line
Loop Until (temp3=Null Or i>135)
doc.processed = "yes"
Call doc.Save(True,True)
Call doc2.save(True,True)
'Notify selected people of new Advantage application
Dim doc18 As NotesDocument
Dim rtitem As NotesRichTextItem
Set doc18 = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc18, "Body" )
doc18.Form = "Memo2"
doc18.Subject = "New Advantage Partner Application"
rtitem.appendText("Please take a look at new application for Advantage Partner received from the Website")
rtitem.addnewline(3)
rtitem.appendText("Click link to open")
rtitem.addnewline(2)
Dim recipients(1) As String
recipients(0) = "att@tech.com"
Call rtitem.appendDocLink(doc2, db.Title)
doc18.Principal = "helpdesk@attotech.com@Technology"
Call doc18.Send( True, recipients)
End If
Set doc = nextDoc
Loop Until (doc Is Nothing)
End Sub