Email Multiple Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyWaterloo
    New Member
    • Dec 2007
    • 135

    Email Multiple Reports

    I am currently using...
    Code:
     DoCmd.SendObject acReport, BactPDF, acFormatPDF, Me.Text199, , , "BacT Results " & Me.Report_Heading
    ...to email my report. I have now come up against a need to send multiple reports on a single email. How is this done? The SendObject command seems to be designed to only send one report per email. How do I send more than one pdf report on a single email? Ideas?

    Thank You
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Check out the code from pianoman in:


    This will allow multiple attachments.

    Nic;o)

    Comment

    • MyWaterloo
      New Member
      • Dec 2007
      • 135

      #3
      Thank You. That works... almost. The problem is that my files that need sending will not always have the same name. Is there anyway to have the file name pulled from a field on my form?

      Code:
      Set objectlookAttach = .Attachments.Add("C:\Temp\[Me.BacTName].pdf")
      Where the data in the field [Me.BacTName] is what the file will be named. This code doesn't work like this, but it does show what I am trying to do.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32662

        #4
        Nearly there :-) Try this instead :
        Code:
        Set objectlookAttach = .Attachments.Add("C:\Temp\" & Me.BacTName & ".pdf")

        Comment

        • MyWaterloo
          New Member
          • Dec 2007
          • 135

          #5
          Of course! Using "&". Thank you! It works fabulous now.

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32662

            #6
            No worries. Don't forget to set Nico's post as the Best Answer ;-)

            Comment

            Working...