Topics Search

Send Email With Attachment (report) Via Outlook Using Vba

Send Email With Attachment (report) Via Outlook Using Vba
Views: 39
I am wanting to send an email with an attachment (Report) via Outlook using VBA. Could anyone direct me as to how to go about this
Sponsored Links:

More topics

 

Send Report and Attachments in Email

Preview
User is looking at a job details. Job has pictures and PDF's as external files saved in the filesystem of the computer. User clicks Email Invoice. System attaches report as a PDFand opens Outlook Email message with email address, subject and body filled and the report PDF as an attachment

I can currently send a report as an attachment in an Outlook Email by using the "DoCmd.SendObject acSendReport" code.

That works nicely for me because it attaches the report I specify but has the limitation that I cannot attach any other objects.

I therefore came across the following code which allows me to add multiple attachments to an Outlook email message:

[CODE]

The problem with the above is that I cannot figure out how to attach a report of my choice. I don't know if there is a way to tell access to open a report and attach it as a PDF (in the above code).

Worst comes to worst, I'll try to figure out a way to save the report as a PDF (to the local filesystem) and then attach that as one of the attachments.
 

Docmd.SendObject and bypassing Outlooks Security Warnings

Preview
I have found solutions online to bypass the outlook security message whenever you try to send a email with an attachment using outlook in access but, I do not understand how they work. I was wondering if someone could help me in find a solution to my problem.

Problem:

I need to create a form that opens which automatically runs a report and sends an email without a user. Meaning that some how I need to bypass the Outlook security message. This is the code I am currently using to send the email out
 

Email report as body of email

Preview
I want the user to click a button (on the form) that generates an html report and sends an email, through Outlook 2010, with that report being the body of the email not as an attachment.

I'm looking to accomplish this through VBA and I have tried everything that I can think of and still am unable to get it to work.
 

Send stored attachment via email

Preview
I am working with Access 2007. In my application users can store files in the database. For that I am using the attachment - datatype.

When a user sends an email from Access through Outlook I would like to attach this file (if there is one stored in that record).

Sending and everything works fine, but how do I select the attachment to get it into the email?

This is the attachment part in my email code:

If Not IsMissing(xxxx) Then
Set objOutlookAttach = .Attachments.Add(xxxx
 

Send report as attachment

Preview
I'm trying to send report called "Harmonogram" as attachment in e-mail. I don't want to use send object method because sometimes I need to sent more files as attachment. Here is the code I use:

Dim objOutlook As Outlook.Application Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application") Set objEmail = objOutlook.CreateItem(olMailItem) Set thereport = CurrentDb.OpenRecordset("Harmonogram")
Email = Me.Email
With objEmail .To = Email .Subject = Harmonogram .Body = text .Attachments.Add thereport, olByReference, 1, "Harmonogram" .Display End With
Set objEmail = Nothing

I have found this code on Internet but there is a problem in line: .Attachments.Add thereport, olByReference, 1, "Harmonogram". It shows me an error message: Data type conversion error. - 3421.
 

Filter a Report Based on an Attribute a to be Emailed VBA

Preview
I'm using Windows 7, Access 2007, Outlook 2010

Background:
I've written the script to generate the email, attach the report (actually in the body of theemail) and send it to the correct people.

Issue:
My issue is that I want to send only the relevant records from the report to each person. I've put the relevant person's email into the report (of a query) to make it easier. I want to email all the records with one email address to that email address and so on.

Example:
This would mean, for example, there are 6 records with [@email] in the email field of the report and 3 records with [@email]. I want the 6 records with [@email] to be emailed to [@email]and the 3 records with [@email] to be emailed to [@email].
 

Sending an Access Report as an attachment via Outlook automatically

Preview
I'm trying to send an existing Access Report as an attachment via MS Outlook. The SendObject method is not an option.

Since, the report I'm trying to send is an access object it is not stored at a particular path on the PC/network.
 

Send email with attachment from access

Preview
But I want to use vba to add the persons name to the beginning of the email? can not find a way, Was able to Make adoc in word that would add the customer name but can not add the report as an attachment
 

Display email in Outlook from Access VBA

Preview
AS my users do not want to auto-send an email message generated from within Access 2003, I am using .display instead of .send to show the Outlook message (Word is the Outlook word processor).

Can anyone tell me how I can detect whether the "Send" button on the email message was clicked on from within Access VBA?
 

Send in Email Body vice Attachment

Preview
Got a report I want my user to be able to send by just clicking a button on the Switchboard. But the data has to go as part of the body of the eMail and not embedded as an attachment.

Is there any way to design a Macro that will let you do this