Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email macro

Status
Not open for further replies.

thabrane

Programmer
Aug 20, 2003
94
US
Hello,
I am working on a macro for emailing impromptu reports as pdf attachments from Lotus Notes. The macro is working fine emailing single reports. I was just wondering if anyone knows how I can send multiple reports in one email. I have not been successful getting this to work.

I was not able to find any other posts relating to this, so if somebody knows one, can you please refer me?

Thank You
 
Hello,
I have since been able to solve this issue and get my macro working properly.
If any one has any questions about this macro, post back and I will be happy to help in any way I can.

Thank you.
 
The traditional method here is to post the problem detail and then post what you found as a solution. That allows the entire TT community to benefit from your experience without having to share email addresses.

Dave G.
 
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


 
Good job. I thought it would work with just multiple calls to attach/embed, but I don't use Notes so I wasn't sure.

A star for your efforts! This is the first TT example for emailing using Notes with multiple attachments that I am aware of.

Regards,

Dave Griffin




The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top