Hi,
I have a database that sends out emails to users that contains a few reports. I am trying to come up with a way that will combine the reports in 1 email. Is that possible?
Here is my code. - DoCmd.SendObject acOutputReport, "rptPSSREmail" & "rptPSSRMonthlyLaborSalesbyPSSR", acFormatPDF, "myemail.com"
I get an error with the code above because I am trying to combine 2 reports. How do I do this? I am trying to attach 3 reports to one email.
Thanks,
5 4109
Is Microsoft Outlook your E-Mail Client?
- Save/Export each Report as a *.pdf.
- Open Microsoft Outlook using Automation Code.
- Attach each Exported Report (*.pdfs) to the E-Mail which results in an E-Mail being sent to a single Recipient, with multiple Attachments.
The code I have attaches one attachment in Outlook when it opens, but not the 3 attachments. I am not sure how to feed 3 reports into 1 email.
The following Code will: - Create a New Instance of Microsoft Outlook.
- Loop thru every Report in the Database and if it begins with rptPSSR, namely (rptPSSR*) Export that Report in *.pdf Format to the same Folder that the Database is in, Attach that Report to an E-Mail with previously defined Parameters, then finally Delete the *.pdf.
- Once all Reports in the form of *.pdfs have been attached, opens the Outlook Window with the appropriate To:, From:, Subject:, and Body: Fields populated along with Multiple Attachments.
- The Code has been tested and is fully operational'
- 'First, set a Reference to the Microsoft Outlook XX.X Object Library
-
Dim aob As AccessObject
-
Dim oLook As New Outlook.Application
-
Dim oMail As Outlook.MailItem
-
Dim olns As Outlook.Namespace
-
-
Set olns = oLook.GetNamespace("MAPI")
-
-
Set oMail = oLook.CreateItem(0)
-
-
With oMail
-
.To = "MyEMail.com"
-
.Body = "Attached, please find a Summary Report for your review."
-
.Subject = "My Subject"
-
End With
-
-
For Each aob In CurrentProject.AllReports
-
If Left$(aob.Name, 7) = "rptPSSR" Then
-
DoCmd.OutputTo acOutputReport, aob.Name, acFormatPDF, CurrentProject.Path & _
-
"\" & aob.Name & ".pdf", False
-
oMail.attachments.Add CurrentProject.Path & "\" & aob.Name & ".pdf"
-
Kill CurrentProject.Path & "\" & aob.Name & ".pdf"
-
End If
-
Next
-
-
oMail.Display
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Alfred |
last post by:
Hi
I am using access 2002
1.0 I want to email a word or html file using the docmd.sendobject The
document must be send as a attachment.
2.0 Second I would like to tell the Docmd.Sendobject to...
|
by: Tom Louchbaum |
last post by:
When I preview my Access 2000 Report it looks fine. When I Email the
report using
DoCmd.SendObject acSendReport, "Report", acFormatRTF, "To Address", , ,
"Subject", , False
the resulting...
|
by: Mega1 |
last post by:
is this possable to send more than 1 report in one email
|
by: jerry.ranch |
last post by:
I collect information from my clients with an xls file
I import the xls data into my access table.
I don't have them put info directly into Access, because, despite the
drop downs I have for...
|
by: RobH |
last post by:
i currently send a report to a reciepient using the Docmd.Sendobject acSendReport which works really well - now my customer wants two reports sent in the same email..
Any thoughts???
|
by: neosam |
last post by:
Hey all,
I am not able to integrate these 2 actions in one command. What i am doing is...
A button which sends a report with only specific data to a particular person (via outlook). I am able to...
|
by: iBasho |
last post by:
Hi,
I am trying to set up a notification email that would come to my email everytime users click on a command button in a form. I am using the DoCmd.SendObject command without actually sending any...
|
by: MyWaterloo |
last post by:
I am currently using... DoCmd.SendObject acReport, BactPDF, acFormatPDF, Me.Text199, , , "BacT Results " & Me.Report_Heading ...to email my report. I have now come up against a need to send...
|
by: austinboston |
last post by:
I've gone down the road of using docmd.sendobject for sending out reports from an access database because I don't have to save the attachment to media that way, I can just create and send. My problem...
|
by: anoble1 |
last post by:
I am trying to email 3 reports with 1 function where it will email 3 attachments. Right now, i can only send 1 attachment at a time. My question is; how do I send multiple reports along with this:...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |