Hi All,
I created an agent to send mail with attachment my problem is that it is not coming in order.When a user opening his mail box it showing attachment first and then the text.I want text first and at last the attachment so help me for doing this.
Here is the agent----
Sub Initialize
'On Error Resume Next
Dim ns As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim docM As NotesDocument
Dim dc As NotesDocumentCollection
Dim rtitemA As NotesRichTextItem
Dim rtitemB As NotesRichTextItem
Set db=ns.CurrentDatabase
Set dc=db.UnprocessedDocuments
Set doc=dc.GetFirstDocument
While Not doc Is Nothing
key=doc.GetItemValue("attach_10")
Set docM = New NotesDocument( db )
docM.Form = "Memo"
docM.Subject = "Roll-off Resource- " + doc.on_1(0)+ "-"+ doc.txtbt_10(0)
Dim richStyle As NotesRichTextStyle
Set richStyle = ns.CreateRichTextStyle
Dim richText As New NotesRichTextItem(docM, "Body")
Dim x As Integer
'Call richText.AddNewLine( 1 )
Call richText.AppendText(Chr(10)+"This is to inform that "+doc.team_11(0)+" will be rolled off from the project as on "+CStr(doc.rdate(0)))
Call richText.AddNewLine( 2 )
Call richText.AppendText ( "Hi, " )
Call richText.AddNewLine( 1 )
Call richText.AppendText(Chr(10)+"Please send the attached Termination Form to BT Onboarding for processing.")
Call richText.AddNewLine( 1 )
Call richText.AddNewLine(1)
Set rtitemA = doc.GetFirstItem( "attach_10" )
Set rtitemB = docM.CreateRichTextItem("attach_10")
Call rtitemB.AppendRTItem( rtitemA )
Call richText.AppendText(Chr(10)+doc.signatute(0))
docM.SendTo =doc.s_Pro_10(0)
docM.copyTo =doc.s_Additionalpro_10(0)
docM.BlindCopyTo =doc.bcc_pro_10(0)
Call docM.Send( False )
'Call docM.Send( False ,doc.empname(0)+"@Domin")
Set doc=dc.GetNextDocument(doc)
Wend
End Sub