Emailing 2 reports

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dee

    #1

    Emailing 2 reports

    I need to send an email containing 2 reports.

    I have tried sending a 2 page snapshot report, but while it prints
    just fine before sending, email is only receiving 1 page.

    Is there a way to do this in VB code?

    Can I somehow program the 'Attach:' line in outlook express to include
    'Report1' and 'Report2'?
    If there is, I would very grateful for a few lines of code.

    If this cannot be done, is there another way?
  • ARC

    #2
    Re: Emailing 2 reports

    Outlook express uses the MAPI method (simple docmd.sendjobje ct), which does
    not support additional attachments other than the report you are sending.
    For additional attachments, you'll need to use full outlook (not express or
    windows mail), and the coding changes quite a bit. Look at the sample code
    below, and you'll see where you can add additional attachments. Hope this
    helps,

    (There are a number of Me![FieldName] references below that refer to options
    for importance, read receipt, etc. from the form the code is taken from).

    Dim objOutlook As Object, sendaddr As String, MainLoopNum As Integer,
    MainMail() As String, ExpFile As String, addlattach As String
    Dim objOutlookMsg As Object
    Dim objOutlookRecip As Object
    Dim objOutlookAttac h As Object
    Set objOutlook = CreateObject("O utlook.Applicat ion")
    ' Create the message.
    Set objOutlookMsg = objOutlook.Crea teItem(olMailIt em)
    '
    addr = Trim$(Me!txtEma il)
    With objOutlookMsg
    Set objOutlookRecip = .Recipients.Add (addr)
    objOutlookRecip .Type = olTo
    End With
    '
    With objOutlookMsg
    ' Set the Subject, Body, and Importance of the message.
    .Subject = Me!txtSubject
    'If Me!chkEnableRic h = -1 Then
    ' .HTMLBody = Me!txtBody
    'Else
    .Body = Me!txtBody
    'End If
    If Me!cboPriority = 2 Then
    .Importance = olImportanceHig h 'High importance
    End If
    '
    'Check for read receipt
    If Me!ChkReceipt = -1 Then
    .ReadReceiptReq uested = True
    End If
    'ReadReceiptReq uested

    Set objOutlookAttac h = .Attachments.Ad d(ExpFile)
    'additional attachments, repeat below
    'Set objOutlookAttac h = .Attachments.Ad d(ExpFile)

    '
    ' Resolve each Recipient's name.
    For Each objOutlookRecip In .Recipients
    objOutlookRecip .Resolve
    'If Not objOutlookRecip .Resolve Then
    'objOutlookMsg. Display
    'End If
    Next
    'objOutlook.vis ible = True
    '.Send
    .Display
    End With
    'Set objOutlookMsg = Nothing
    Set objOutlook = Nothing
    DoCmd.Hourglass 0
    DoEvents

    Comment

    • Earl Anderson

      #3
      Re: Emailing 2 reports

      If you are considering "another way" of sending reports, consider a 'pdf'
      file converter such as "nova PDF Pro" which installs itself on your machine
      as one of your 'printers' on your "Printer List". When you bring up your
      report and select File-->Print, and select 'novaPDF Pro as your 'printer',
      it puts that report into a 'pdf' file to be 'saved' wherever you like and
      then you can send it as an email attachment whenever. The advantage is that
      as a 'pdf' file, your recipient does not have to have MS Access installed or
      even MS Office as is the case with the 's.np' file format.

      Earl


      "dee" <promotions.mar keting@comcast. netwrote in message
      news:e1c00a63-515a-4157-ba46-e14f426cf225@d1 0g2000pra.googl egroups.com...
      >I need to send an email containing 2 reports.
      >
      I have tried sending a 2 page snapshot report, but while it prints
      just fine before sending, email is only receiving 1 page.
      >
      Is there a way to do this in VB code?
      >
      Can I somehow program the 'Attach:' line in outlook express to include
      'Report1' and 'Report2'?
      If there is, I would very grateful for a few lines of code.
      >
      If this cannot be done, is there another way?

      Comment

      • Salad

        #4
        Re: Emailing 2 reports

        Earl Anderson wrote:
        If you are considering "another way" of sending reports, consider a 'pdf'
        file converter such as "nova PDF Pro" which installs itself on your machine
        as one of your 'printers' on your "Printer List". When you bring up your
        report and select File-->Print, and select 'novaPDF Pro as your 'printer',
        it puts that report into a 'pdf' file to be 'saved' wherever you like and
        then you can send it as an email attachment whenever. The advantage is that
        as a 'pdf' file, your recipient does not have to have MS Access installed or
        even MS Office as is the case with the 's.np' file format.
        >
        I used NovaPDF for a while but due to some problems I had with it on
        dualcore PCs I switched to Stephen Lebans snapshot to PDF converter and
        it works like a champ. I liked NovaPDF because one could specifiy the
        folder and filename to save it to.
        Earl
        >
        >
        "dee" <promotions.mar keting@comcast. netwrote in message
        news:e1c00a63-515a-4157-ba46-e14f426cf225@d1 0g2000pra.googl egroups.com...
        >
        >>I need to send an email containing 2 reports.
        >>
        >>I have tried sending a 2 page snapshot report, but while it prints
        >>just fine before sending, email is only receiving 1 page.
        >>
        >>Is there a way to do this in VB code?
        >>
        >>Can I somehow program the 'Attach:' line in outlook express to include
        >>'Report1' and 'Report2'?
        >>If there is, I would very grateful for a few lines of code.
        >>
        >>If this cannot be done, is there another way?
        >
        >
        >

        Comment

        Working...