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 multiple reports at a time in one mail

Status
Not open for further replies.

nandamurisrihari

Programmer
Dec 25, 2002
25
BH
Hi,
IAM ABLE TO SEND ONE REPORT THROUGH EMAIL WITH THE FOLLOWING CODE

DoCmd.SendObject acSendReport, objectname, acFormatTXT

How can i send multiple reports in one mail???

regards
srihari
 
Hi,

I do this by saving a copy of the attachments to a Temp file, then using a instance of Outlook to attach the files and send. The code looks like

Code:
Dim appOutLook As Outlook.Application
    Dim MailOutLook As Outlook.MailItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)

        With MailOutLook
            .To = "xxx"
            .Subject = "xxx"
            .HTMLBody = "xxx"
            .Attachments.Add "C:\Temp\xxx.snp", olByValue, 1, "xxx_SNP"
            .Attachments.Add "C:\Temp\xxx.RTF", olByValue, 1, "xxx_RTF"
            .Display
        End With[Code]

This can be done for more than two reports and in different styles.  Just add the code to a button on access and it should work.

Hope this helps, Let me know Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit 
  and wisdom to do their job properly.
 
nandamurisrihari (Programmer)
On Jan 21, 2003 you wrote:
Hi,
IAM ABLE TO SEND ONE REPORT THROUGH EMAIL WITH THE FOLLOWING CODE

DoCmd.SendObject acSendReport, objectname, acFormatTXT

How can i send multiple reports in one mail???

regards
srihari

Ca you tell me how to send one report at a time?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top