Hello,
Below is the subroutine which I used to send an email from Lotus Notes which has multiple Impromptu reports saved in pdf format and emailed to a user. This particular portion email 3 seperate reports together in one email.
Please let me know if anyone has qny questions regarding this code.
Thank You
'This subroutine is called from the loop in the Main routine to send the email
Sub LotusNotes(strSubject$, strTo$, strBody$, strReportPath$, strReport1Name$, strReport2Name$, strReport3Name$)
dim IngDirectory As Object
Dim IndDatabase As Object
Dim IndDocument As Object
Dim IndRTItem As Object
'Lotus assigns the integer 1454 to EMBED_ATTACHMENT
Const EMBED_ATTACHMENT = 1454
'Concatenate report path & name to form attachment
strAttachment1$ = strReportPath$ & strReport1Name$ & ".pdf"
strAttachment2$ = strReportPath$ & strReport2Name$ & ".pdf"
strAttachment3$ = strReportPath$ & strReport3Name$ & ".pdf"
Set IngDirectory = IndSession.GetDbDirectory("")
Set IndDatabase = IngDirectory.OpenMailDatabase
Set IndDocument = IndDatabase.CreateDocument
'--Set Message Headers
Call IndDocument.AppendItemValue("Subject", strSubject$)
Call IndDocument.ReplaceItemValue("SendTo", strTo$)
'---Set Delivery Options
IndDocument.EncryptOnSend = False
IndDocument.SaveMessageOnSend = False
'IndDocument.ReturnReceipt = True
Call IndDocument.ReplaceItemValue("ReturnReceipt", True)
'---Add Content
Set IndRTItem = IndDocument.CreateRichTextItem("Body")
IndRTItem.AppendText(strBody$)
Set IndRTItem = Nothing
Set IndRTItem = IndDocument.CreateRichTextItem("MyRichText" & i)
'msgbox strAttachment$
call IndRTItem.EmbedObject(EMBED_ATTACHMENT, "", strAttachment1$)
call IndRTItem.EmbedObject(EMBED_ATTACHMENT, "", strAttachment2$)
call IndRTItem.EmbedObject(EMBED_ATTACHMENT, "", strAttachment3$)
Set IndRTItem = Nothing
'---Send Message
call IndDocument.Send( FALSE )
End Sub