Consulting

Results 1 to 9 of 9

Thread: Solved: Sending Report via E-Mail

  1. #1

    Solved: Sending Report via E-Mail

    Is there a way of automatically sending a report via e-mail? I have generated a few reports in Access and need to get them to other people in the company. Currently, I am saving them to rtf files with the Word link and then sending the rtf file via email. I would like to do it all from Access automatically.

    We use Lotus Notes for E-Mail.

    ttfn
    Kicker

  2. #2
    VBAX Tutor SJ McAbney's Avatar
    Joined
    May 2004
    Location
    Glasgow
    Posts
    243
    Location
    I believe you can make a snapshot of the report and send that within an email.

  3. #3
    VBAX Regular
    Joined
    May 2004
    Location
    Sydney, Australia
    Posts
    36
    Location
    Hi,

    You can use the SendObject method to do this. This example should give you the idea:

    [VBA]
    DoCmd.SendObject ObjectType:=acSendReport, _
    ObjectName:="MyReport", _
    OutputFormat:="Rich Text Format", _
    To:="someone@somewhere.com", _
    Subject:="Subject goes here", _
    MessageText:="And you can put body text here", _
    EditMessage:=False 'This determines whether the message will be displayed or just sent
    [/VBA]

    HTH
    Dan

  4. #4
    Daniel:

    That works great....It took me all of 45 seconds to drop that code into my test application and see it work. Now, if it works at work with Lotus Notes as well as it does at home with MS Outlook, I am in great shape.

    ttfn
    Kicker

  5. #5
    VBAX Regular
    Joined
    May 2004
    Posts
    42
    Location

    Send Object

    When you do this the report loses all of it's lines and check boxes. Is there a way to retain the same formatting that is in Access?

  6. #6
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    I hope not, because I've wasted hours of work formatting my reports in vba in Word.

  7. #7
    VBAX Regular
    Joined
    May 2004
    Posts
    42
    Location
    I do not want to format the report in word I would like to keep the same formatting that is in Access. Any lines that are created in Access do not come over when you sendobject.

  8. #8
    VBAX Expert xCav8r's Avatar
    Joined
    May 2005
    Location
    Minneapolis, MN, USA
    Posts
    912
    Location
    I never wanted to do it either. Had to. As an alternative, you might try printing the report to distiller or something equivalent.

  9. #9
    VBAX Tutor GaryB's Avatar
    Joined
    Jun 2004
    Location
    Stockton, California
    Posts
    270
    Location
    Hi everyone,

    One thing we have been doing a lot of is printing our reports out as an PDF file, It keeps all of the formating exactly like the report, and then emailing it as an attachment.

    GaryB

Posting Permissions

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