Results 1 to 7 of 7
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    I have a report in Access 2007 that needs to be emailed alongwith a spreadsheet.

    Is there a simple way to do this in Access 2007 or am i up for creating the report in PDF format using Stephan Lebans code and other code to attach that PDF file as well as the Excel file as attachments?

    I know how to do the latter but if theres a better way in Access 2007 i would like to know.
    Thanks.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Patt

    Access 2007 has built in support for pdf if you download the pdf plugin

    With that you can send pdfs using docmd.sendobject us acFormatPDF as the format.

    However docmd.sendobject does not support attachments that are not database objects.

    So you need to use automation.

    Docmd.OutputTo also has built in pdf support so you could use that to save the report as a pdf before attaching it.
    Regards
    John



  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Thanks John, I had just found out about OutputTo which will overcome the creation of the report in PDF format.

    Do i need the special code to send multiple attachments in an email from Access 2007? I have a SendMail code snippet from the past, I will have to see if this can send multiple attachments, i Know it can send at least one.

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by patt View Post
    OutputTo which will overcome the creation of the report in PDF format.
    Isn't Outputto a way of creating the report in PDF format, rather than an alternative?

    I don't see any problems having two attachments.

    Just duplicate all the lines of code that define and attach it.

    Regards
    John



  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Just my way of saying the same thing for the OutputTo.

    Thanks.

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Note that you get that capability, in addition to the fix for the Excel export if you apply Service Pack 2 of Office 2007. We've been using it at several clients for half a year or so and it seems pretty solid. And the PDF export works so much better than the export to RTF.
    Wendell

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    Fair comment re the RTF Wendell.

    I now have code using OutputTo to create both files, Excel and PDF before using Han's routine SendMail to send the emails with 2 attachments.

    Works like a charm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •