Results 1 to 7 of 7
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    SendObject email (2002)

    Looks like my customers are going to drag me kicking and screaming into the 21st century whether I like it or not. I had really grown quite comfortable with faxing my Access report via Winfax Pro, but now (beginning 2/01/04) they will only accept them via email. I
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SendObject email (2002)

    That's a tall order!

    In order to be able to send a report for an indivual ProNo and CarrierName, create a query that has the txtProNo and txtCarrierName controls on frmOrderDetail as parameters. Set the Record Source of the report to the name of this query.

    DoCmd.SendObject cannot send a report as the body of an e-mail. It always creates an attachment. The only export format that looks like the formatted report is snapshot. However, this requires the recipient(s) to have the (freely downloadable) snapshot viewer. Other export formats (Excel, Word/RTF, HTML, text) lose much of the formatting. On the other hand, SendObject has an argument to specify whether you want to view the e-mail before it is sent.

    An alternative would be to print the report to a PDF document. You need to have software that creates PDF's. The recipient needs the Adobe Reader to view it, but many computer users already have that.

    If you want to send the report in the body of the e-mail, you'd probably be better off using Automation to create a formatted Word document and to send that - Word can send a document as the body of an e-mail. In moderator <!profile=WendellB>WendellB<!/profile>'s profile you will find a link to his website. Under Support > Tutorials you will find a short tutorial on Automation, with useful links. Be prepared to find that this is far from trivial stuff.

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: SendObject email (2002)

    Hans:

    Thanks for the reply (your
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SendObject email (2002)

    Although Access will allow you to put a command button on a report, it is useless since you won't be able to click it - the only things you can do with a report ar viewing it and printing it, there is no further interaction. You could send the report from a command button on the frmPrintFaxOptionsDispatch form:

    Dim strReportName As String
    Dim strRecipient As String
    Dim strSubject As String
    Dim strMessage As String
    Dim blnEditMail As Boolean

    strReportName = "rptFreightOrder"
    strRecipient = Me.txtCarrierName
    strSubject = "Load Confirmation Attached"
    strMessage = "Please see the attached Load Confirmation." & vbCrLf & "Regards, bfxtrfcmgr"
    blnEditMail = True

    DoCmd.SendObject acSendReport, strReportName, acFormatSNP, strRecipient, , , strSubject, strMessage, blnEditMail

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: SendObject email (2002)

    Hans:

    Ah, to be in the presence of genius! Good morning (or evening as the case may be).

    That works rather well, but I
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: SendObject email (2002)

    1. If you don't want to modify the original query, make a copy and name it, say, qryProNoMail. Open this query in design view, and change the parameter to

    [Forms]![frmPrintFaxOptionsDispatch]!txtProNo]

    Then, set the Record Source of the report to qryProNoMail.

    2. You can create your own body text message. Concatenate strings with & and use vbCrLf to start a new line; if you want to leave a line blank, use two vbCrLf's:

    strMessage = "Please see the attached Load Confirmation," & vbCrLf & vbCrLf & _
    "Regards," & vbCrLf & "Bryan"

    If you want to change this, you should be able to do so yourself now.

  7. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: SendObject email (2002)

    Hans:

    Perfect! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23> And I actually learned something.

    I just received the request from my customer yesterday, with the expectation that all carriers would be in compliance by the first of February. When I email my report to them this morning they're going to be blown away! You have, indeed, made me out to be a hero. Thank you, again, so very much!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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