Have the code below in an agent, this agent is triggered by a button, the agent is set for selected docs and is triggered while in a particular record. It is sending the tracer needed, but for some reason it is freezing up my system. Is there something I have wrong in here which would freeze everything up like that.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim emaildoc As NotesDocument
Dim Item As NotesItem
Dim twoliner As String
Dim rtitem As NotesRichTextItem
Set db = session.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument
On Error Resume Next
While Not doc Is Nothing
If doc.input_flag(0)<>"done" Then
Set emaildoc = db.CreateDocument
emaildoc.form = "bb_input" 'Form name of Letter
emaildoc.SendTo = doc.EE_Name(0)
emaildoc.Principal = "Field Technology"
emaildoc.Subject ="Order for " + doc.name_adjusted (0)+ " has been forwarded for processing."
doc.input_flag = "done" 'field name for flag
doc.status = "Order Input"