Attach multiple reports to GroupWise e-mail

I need to attach multiple reports (.rtf documents) to an e-mail that is being sent to multiple recipients.

Does anyone know how to automate this with Access 2000 and GroupWise Version 5.5 e-mail?


Sponsored Links:

I have a form set up with multiple option buttons for the user to select a report to e-mail. The final option button is for the user to select "all" reports to e-mail. I am using Select Case and then on the "all reports" case, it has a DoCmd to open each report one at a time and send each via email as a snapshot. (I can't find a way to send multiple reports on one e-mail). The problem is, the user wants to attach a new subject line each week when the report is sent. I don't want it to stop on each report (the reports take a long time to run). I was thinking I could add a field to the form for the user to type in the new subject line for that week and have the code referenct that field, but I don't have a clue as to how to begin. Anyone with any ideas?? Thanks!!

okay...hopefully a really simple question....does anyone know how to attach a report as an e-mail attachment????

Thanks in advance!!!


There are a load of threads on e-mailing reports, but I couldn't find one that answered this question. Is there a SendObject command that will attach multiple reports in one e-mail. For example I have the following code in a form:

DoCmd.SendObject acReport, "REPORT1", "SnapshotFormat(*.snp)", "", "", "", Forms![PAGE1AQS]![NamedInsured]

However, I want to also send "REPORT2" or "REPORT3" in the same e-mail. Can this be accomplished? Thanks in advance for your invaluable insights.


Does anyone know how to attach a word document to a e-mail from a database through code. I have a list of clients in a database with their e-mail addresses and I need to send an e-mail to them with a attachment. There are about 1000 clients that need this e-mail.

Any help would be appreciated!

Hello everyone,

I would really really appreciate if someone can assist me with the VBA coding for this process... or let me know if this is even possible.
I am using Access 2002-2003 as a Microsoft Access Project using SQL Management Studio as a backend server.

I need help creating a VBA code for a button on a form that would sebd multiple reports as individual e-mail attachments. Each e-mail would be sent to an address which is referenced as one of the form's field controls.
The form would first be filtered so the report is filtered accordingly.
The report itself is a certificate which is used to confirm a person's completion of an educational course. Fields for Name, Organization, Course, and Semester are used. Semesters are by year as Spring, Summer, or Fall.

So far, I have only used code to filter the report based on the form:

Private Sub Report_Open(Cancel As Integer)
Me.Filter = "Semester='" & Forms![Agency_University_Certificates_for_Email]![Semester] & "'"
Me.FilterOn = True
End Sub

Is it possible to click a button on the form which can send the filtered report to multiple e-mail addresses? I want the reports to be separated and sent according to each e-mail address (basically a mail merge).

Thank you for your assistance and guidance and for reading this post. I am open to any suggestions!

When using MSAccess 2002 the VB line :
'DoCmd.SendObject acTable, "tblSend", "MicrosoftExcelBiff8(*.xls)", "E-Mail Address", "", "", "A60", "Orders", False, ""
Would send to the E-mail Address that was listed in E-Mail Address but converting to MSAccess 2003 and using the same Email GroupWise 7.03 It leaves the To blank any ideas?


This is forum has been very helpful to me on my latest database project. I'm now stuck and hoping you all can help me out. This is an urgent request so hopefully someone here has dealt with the same problem.

First off, I hope I'm posting in the right forum.

I'm printing a report to .pdf. I'm using pdf995 and pdf995edit. Upon creating the file, I have code that automatically attaches the file to an e-mail. Everything works great, but I'm finding that after the code executes, the pdf995 printer remains the default. Ideally, I would like the code to execute, print to the pdf995 printer and reset the default printer to the applicable network printer. This is also running across a network. The pdfwriter is on the client, while the database is on a server. Here's the code I'm using now.

	Private Sub btnEmail_Click()

' If you don't want the report dialog box being displayed
' asking what name you want to give the pdf report, you will
' need pdfEdit995.  With pdfEdit995t you tell pdf995 what directory
' and what file name to initially give the pdf report.
' Quote from PDF; "pdfEdit995 has autoname features. I recommend setting
' the PDF to be named based on the document being printed. Create a
' temporary report with the name of the PDF you want and tell it to
' print to PDF995. The Save As dialog won't appear."

    Dim strDir As String
    Dim strFile As String
    Dim fOK As Boolean

    ' Directory to place the PDF files that are to
    ' be printed
    strDir = "D:Documents and SettingsHeatherMy DocumentsOutsourced ProjectsTyco"
    ' Name of file to create
    strFile = "DFM Summary Statistics Queried " & Format(Date, "Long Date") & ".pdf"
    ' Create the report
    DoCmd.OpenReport "rptStats", acViewNormal
    ' Copy the created file (name is Output.pdf) to the
    ' directory and file name specified above
    fOK = CopyFile_TSB(strDir & "Output.pdf", strDir & strFile)
     'If the file didn't copy properly, tell the user
    If Not fOK Then
       MsgBox "File Copy Failure"
   End If
SendMessage (strDir & strFile)
End Sub

Function CopyFile_TSB(strSource As String, strDestination As String) As Boolean
' Comments  : copies a file
' Parameters: strSource - source file
'             strDestination - destination file
' Returns   : True if successful, False otherwise
    Const BufferSize = 9000

    Dim strBuffer As String * BufferSize
    Dim strTempBuffer As String
    Dim intSourceFile As Integer
    Dim intDestinationFile As Integer
    Dim lngCounter As Long

    On Error GoTo PROC_ERR

    intSourceFile = FreeFile
    Open strSource For Binary As #intSourceFile

    intDestinationFile = FreeFile
    Open strDestination For Binary As #intDestinationFile

    For lngCounter = 1 To LOF(intSourceFile)  BufferSize
        Get #intSourceFile, , strBuffer
        Put #intDestinationFile, , strBuffer
    Next lngCounter

   lngCounter = LOF(intSourceFile) Mod BufferSize

    If lngCounter > 0 Then
        Get #intSourceFile, , strBuffer
        strTempBuffer = Left$(strBuffer, lngCounter)
        Put #intDestinationFile, , strTempBuffer
    End If

    Close #intSourceFile
    Close #intDestinationFile
    CopyFile_TSB = True

    Exit Function

    CopyFile_TSB = False
    Resume PROC_EXIT

End Function

Private Sub btnCancel_Click()
On Error GoTo Err_btnCancel_Click

    Dim stDocName As String

    stDocName = "CustStatsSelect.Cancel"
    DoCmd.RunMacro stDocName

    Exit Sub

    MsgBox Err.Description
    Resume Exit_btnCancel_Click
End Sub

Sub SendMessage(Optional AttachmentPath)

           Dim objOutlook As Outlook.Application

               Dim objOutlookMsg As Outlook.MailItem

               Dim objOutlookRecip As Outlook.Recipient

               Dim objOutlookAttach As Outlook.Attachment

               ' Create the Outlook session.

               Set objOutlook = CreateObject("Outlook.Application")

           ' Create the message.

           Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

           With objOutlookMsg

              ' Add the To recipient(s) to the message.

             Set objOutlookRecip = .Recipients.Add("")

              objOutlookRecip.Type = olTo

              ' Add the CC recipient(s) to the message.

              Set objOutlookRecip = .Recipients.Add(" ")

              objOutlookRecip.Type = olCC

              ' Set the Subject, Body, and Importance of the message.

              .Subject = "DFM Statistics Summary"

              .Body = ""

              .Importance = olImportanceHigh  'High importance

              ' Add attachments to the message.
                Dim strFile As String
                strFile = "D:Documents and SettingsHeatherMy DocumentsOutsourced ProjectsTycoDFM Summary Statistics Queried "
& Format(Date, "Long Date") & ".pdf"

              If Not IsMissing(AttachmentPath) Then

                 Set objOutlookAttach = .Attachments.Add(strFile)

              End If

              ' Resolve each Recipient's name.

              For Each objOutlookRecip In .Recipients


                 If Not objOutlookRecip.Resolve Then


              End If



           End With

           Set objOutlookMsg = Nothing

           Set objOutlook = Nothing

        End Sub

I appreciate any help you can give me!

Thanks in Advance


how do you attach multiple reports in an email through code to put behind a button?

Two questions...

1) I have a form where orders are inputted. I want a button to be able to be clicked with will open a form based on the value of the autonumber (order number) how do I do this?

2) How can I get a report to be e-mailed to the address that is shown on the report (I enter the data when the order is processed) without having to manually enter the e-mail address into outlook when i press the mail report button

Does this make sense?

I create a little template in word, which has pop up forms and then the last form you have the choice to send the document automatically to a specific recipient by outlook, but the problem is that when the program opens outlook, by default everyone has the "Use Microsoft Word to edit e-mail messages" check.

I was able to find this on the microsoft website...

When you are using Microsoft Word to edit e-mail messages (in Microsoft Outlook 2000, on the Tools menu, click Options and then click the Mail Format tab) and you try to automate Word from another program, you may encounter problems processing some Word commands. For example, you may receive Automation errors such as "This method or property is not available" or other errors.

This article describes how to check whether WordMail is running when using Automation to automate Word from another program.

This is the code I have in my function to send the document in Outllook.

Public Function SendMessage(DisplayMsg As Boolean, Optional AttachmentPath)

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.mailitem
Dim objOutlookRecip As Outlook.recipient
Dim objOutlookAttach As Outlook.attachment

'Create the outlook session.
Set objOutlook = CreateObject("Outlook.Application")
'Create the message
Set objOutlookMsg = objOutlook.createItem(olMailItem)
With objOutlookMsg
'Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("mtlserrurerie")
objOutlookRecip.Type = olTO
'Set the subject, Body,and Importance of the message
.Subject = "Demande de clé"
.body = ""
.importance = olimportancehigh 'High Importance
'Add attachment to the message.
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If
'Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
'Should we displaythe message before sending?
If DisplayMsg Then
End If
End With
Set objOutlook = Nothing

End Function

I was wondering if I can code the form to remove the check mark from the Option in Outllook.

I am using OfficeXP

hi frnds

i have an access application in which some reports are generated.
i want to add e-mail feature in this application, so that the reports can
be send via e-mail.

please also tell me how to disable keyboard shortcuts for numerous option like open,close,save,new etc ( through vb code )


I am trying to send e-mails to customers in a batch with my Access database. I have created a recordset with the desired document id's and I have put a sendobject statement in a loop of this recordset.

	DoCmd.SendObject acSendReport, "rptInvoice", acFormatPDF, email, , , subject, msgText, False

The problem is, the report, wich is the invoice, needs to be filtered separately for each e-mail / pass of the loop. The only way I can think of to do this in code is to open the report, apply a filter, and save the report. Not sure if this will work or not but if it does it will cause the report to flash on the screen each pass of the loop. Can anyone direct me as to how to e-mail invoice reports in a batch, each one filtered for it's intended recipient?

I am using a form for users to enter requests. Currently when a user enters a request an email is generated using the sendobject command and i send the whole table in .xls format as an attachment to my e-mail. I'd rather when a request is entered that an email is sent to me with only the newest request in the body of the email. How can I go about doing this? As always thans a bunch in advance.

I have a textbox which I allow the User to enter text. Kinda of like an area where it keeps a log activity.

By pressing CTL + ENTER, it will give a LINE BREAK in the text box, which is great.

But if I want to pass the multiline text to an e-mail and/or insert it into a database, how do I preserve the LINE BREAKS from the text box?


Is there a to convert multiple reports to one PDF with VBA? I have a large amount of pdfs to produce around 4000. One of my other large problems I can not download any tools to help with this. I am using access 2010 and I have Adobe PDF Writer installed.

My db uses a command buttom to send e-mail by Outlook.
The following code selects the record to preview then e-mail.
I'd like to be able to select multiple records as attachments on the one e-mail.
I suppose I'd need additional field(s) on the form to select the records but I'm not sure how to write this.
Code or threads appreciated.

DoCmd.OpenReport "email report", acViewPreview, , "[ID]=" & Forms![data]![ID]
DoCmd.SendObject acReport, stDocName, acFormatRTF, , ""," k , "E-mail subject", "There are some attachments (hopefully) with this e-mail", True


Hopefully I've posted this in the right forum.

I would like to automate the current process of sending an e-mail with a PDF attachment that is unique to each recipient; it is their test results. I’m sending an e-mail one at a time (which was fine when the number of folks being tested was small, but now I’m up to approximately 200 e-mails and growing each year) which I’m sure you can appreciate is very time consuming.

Please Note: I’m not a programmer type and I’m ignorant with respect to macro code creation. I'm hoping this type of issue as been faced before (did not find any related posts though) and that a solution is available.

System Environment:
Windows 7 SP1 (64 bit)
Office 2010 Professional

Access environment and Process:
1. A qry object/letter is built based on 4 tables (test results, result averages, a global employee list and location)

2. The Report has both static and dynamic text. Examples include: “Dear” [qry-Letter. F_name] and Address Information
a. =[qry-Letters.F_Name] & " " & [qry-Letters.L_Name]
b. =[qry-Letters.Position]
c. ="Dept " & Right([qry-Letters.Dept],3) & ", " & [qry-Letters.City]

3. The report also includes the employee’s results, the session averages (testing is conducted at multiple locations each occurrence is a session) and companywide averages.

4. Report Process: Run the report, entering primary key Emp_ID, report is populated saved (overwritten with the next Emp_ID and printed as a saved PDF.

5. MS Outlook: create a new e-mail, text body is common to all e-mails e.g. ‘attached are your test results’ the PDF is attached and the e-mail sent to the recipient (the e-mail address follows the corporate standard, =Trim([qry-Letters.F_Name] & "." & [qry-Letters.L_Name] & "")

Hopefully I provided sufficient background information. But if not ask away.

Any assistance in automating the aforementioned process(es) would be greatly appreciated.


Hecanuck (FYI … Male Canadian … smile)

I have made a little database that is used to enter details shipments and where users can print labels for the different shipments showing country, zip code and city of destination. All information is stored in a table for analysis via several reports.

We have two forwarders that we use for our shipments and they should get twice a day a list of destinations for each country; a preliminary and a final list.

For example on a certain day I have:
3 shipments going to France
4 shipments going to Germany
7 shipments going to the UK

What I want is that
Forwarder A gets 1 report e-mailed for France shipments
Forwarder B gets 1 report e-mailed for Germany shipments
Forwarder B gets 1 report e-mailed for UK shipments

so 1 e-mail per country for forwarder A or B

Any ideas how to best solve this complex matter??

I am currently working on a database that will be sending out multiple reports but they need to be sent from different e-mail profiles. I have the two profiles set up but I am at a loss with how to select which profile to use in my code.

Here is a sample:

	Dim obEmail As Object, obMsg As Object, obAttachment As Object, stDelim As String, exAttach As String

stDelim = ";"
Set obEmail = CreateObject("Outlook.Application")
Set obMsg = obEmail.CreateItem(olMailItem)

With obMsg
    .subject = "Ordering Report"
    .To = "users"
    .Body = "Please see attached."
End With

Set obEmail = Nothing
Set obMsg = Nothing

End Function

I thought about using the 'SentOnBehalfOfName' property but from what I've seen this does not change the e-mail address. This is key since the recipients will probably reply back and these replies need to be routed to the correct profile.