The script written in application for queueing NDR reports on hub returns an error

5 pts.
Tags:
Lotus Agents
Lotus Domino
Lotus Notes
Lotus Script
The script written in " Application for queueing non-delivery reports on hub mail server" returns an error after wend command. Is there any way to check and rectify this?  This script is of much use to me.

 

Script is as follows

Sub Initialize         Dim session As New notessession         Dim db As notesdatabase         Dim spam As notesDocumentCollection         Dim spamDoc As notesdocument         Dim rtitem As Variant         Dim object As NotesEmbeddedObject         Dim richStyle As NotesRichTextStyle         Set richStyle = session.CreateRichTextStyle                         Set db=session.currentDatabase         Dim mailboxDb As New NotesDatabase ( db.Server, "mail.box" ) ' if you have more than one mail.box it is better to use 'mail1.box'                 Set spam=db.UnprocessedDocuments         Set spamDoc=spam.getFirstDocument         While Not spamDoc Is Nothing                 Set rtitem = spamDoc.GetFirstItem( "Body" )                 If ( rtitem.Type = RICHTEXT ) Then                         If Not Isempty (rtitem.EmbeddedObjects) Then                                 Forall o In rtitem.EmbeddedObjects                                         If (( o.Type = EMBED_ATTACHMENT )  Or ( o.Type = EMBED_OBJECTLINK ) Or ( o.Type = EMBED_OBJECT )) Then Call rtitem.AddNewLine( 2 ) richStyle.NotesColor = COLOR_RED richStyle.FontSize = 10 richStyle.Bold = True Call rtitem.AppendStyle(richStyle) Call rtitem.AppendText( "Attached file (object) '" & o.Source & "' has been deleted...") Call o.Remove End If   End Forall   End If                         If spamDoc.HasEmbedded Then  Forall i In spamDoc.Items   If i.Type = ATTACHMENT Then Set Object = spamDoc.GetAttachment( i.Values(0) )   Call Object.Remove  End If  End Forall  End If                          spamDoc.FailureReason = spamDoc.FailureReason(0) & "!" 'Mark processed record spamDoc.Processed = "1"   Call spamDoc.Save( True, True )

 Call spamDoc.CopyToDatabase( mailboxDb ) ' copy only if there is NDR with attachments                 End If                                 Call session.UpdateProcessedDoc( spamDoc )                 Set spamDoc=spam.getNextDocument(spamDoc)         Wend                 Set spam=db.unprocessedSearch ({@Contains(Processed;"1")},Nothing,0)         If spam.Count > 0 Then                 Call spam.removeAll(True)         End If         End Sub



Software/Hardware used:
Lotus notes

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following