Send Query In Email Body

Feb 27, 2006

I almost have what I need, but I am not quite there. I am a VBA novice and need help. I couldnt understand some of the code I have searched for on this topic.

I have a query that returns exactly the results I want. By using a SendObject macro I can accomplish sending the message with a .txt file attached. What I want to do is instead of having the attachment I want to send my query "FaxReportQueryReport" in the body of the email. No set address, just a set RE: line of "Today's Deliveries".

View Replies


ADVERTISEMENT

Modules & VBA :: Send Query Results In Table In Body Of Email

May 24, 2014

I have created some code to get the records of a query and it puts them in the body of the email but it doesn't format it well for example the email looks like

James | halliwell | 31
Leanne | smith |27
Alexis | smith |8

I would like it to be in a table is this possible,

Code:
Public Function SendEmail()
Dim MyDB As DAO.Database
Dim rst As DAO.Recordset
Set MyDB = CurrentDb

[Code] .....

View 3 Replies View Related

Modules & VBA :: Send Two Reports In Email Body?

Jan 15, 2015

With the code below , I send the report: “ESERT4H”, in email body. How I could add yet another report on the same body of the email ?

DoCmd.OutputTo acOutputReport, "ESERT4H", "HTML(*.html)", "D:Access empESERT4H.html", False, "", 0, acExportQualityScreen
Dim Out As Outlook.Application
Dim NS As Outlook.NameSpace
Dim Folder As MAPIFolder
Dim Mens As MailItem

[Code] ....

View 7 Replies View Related

VBA To Send Email From Access - Table Pasted In Message Body

Aug 11, 2011

I want to be able to send email and in the body i want the my table be pasted in email body...

Is that possible?

View 3 Replies View Related

Modules & VBA :: Subform In Continuous Records Format - Send Contents Into The Body Of Email

Nov 10, 2014

I have a subform in Continuous Records format (records displayed are determined by controls on the parent). I would like to create a button that prepares an email and copies the contents of that subform in to the body of an email message.

The email. I have a method to create a new email, set To, CC, Subject and even Message Text.

Code:
strTo = txtName
strCC = txtManager
strSubject = "Something"
strMessage = "Hi, please find below list of details from X Y and Z" & vbnewline & vbnewline

That all works. Thats fine

The Records: I have found ways to have them added as an attachment, either the the SendObject and OutputTo method but I would like the list of records to be converted to a text string so I can include it within my strMessage variable, not include it as an attachment.

Code:
strMessage = strMessage & "Subform Records to go here"...

View 7 Replies View Related

General :: How To Send A Single Email Message To All The Email Addresses In Query

Jun 2, 2014

I have a query (Access 2007) that contains a field named "email" (which contains email addresses, of course). I want to email everyone in the query and they are all going to receive the same message. My email to them doesn't have to be personalized and I don't need to collect data from the recipients. I don't even need a reply to the email I send.

View 12 Replies View Related

General :: Send A Specific Email From Outlook To All Email Addresses Within A Query

Jan 21, 2014

I have a database that I can use to create a query, grouping companies by city. I then want to send a specific email I have created in outlook to all of the email addresses in the query.I do not need to include names.

View 6 Replies View Related

Modules & VBA :: Include Query In Body Of Email

Jan 30, 2014

I have a query table in Access 2007 with requests pending an individuals review and approval. I would like to create an automatic email each day to that individual which includes the actual query table impeded as part of the body of the email (not as an attachment).

View 1 Replies View Related

Modules & VBA :: Using Query To Put Data In Email Body?

Apr 22, 2015

I'm trying to put multiple records of data from a subform in a single e-mail, and my Outlook calendar. I have a contracting business, and on my Orders form (which details a single client), I have a sub-form that lists all the items to be done at that client's home (a different record for each work item). When I send an e-mail, or post the appointment to the Outlook calendar, I am trying to list all those records in the body of the e-mail, and/or in the Notes section of the appointment. I created the query to call the records, but have not figured out a way to use it in the code.

View 14 Replies View Related

Forms :: Add Senders Email Address To Body Of Email

Sep 16, 2013

I want to automate an email to include the senders email addres with some text in the body of the email.

Code:
Private Sub send_mail_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open

[Code] ....

View 3 Replies View Related

Send Report From Access In A Body Of An E-mail

Dec 13, 2006

Could you please help me and advise if it's possible to send report from MS Access by mail - having report as a content of an e-mail instead of attachement?

View 2 Replies View Related

Send Email With Data From A Query

Nov 29, 2004

I have a database where I keep track of student employees. The database has three forms, a new hire form, a supervisor form and a financial aid form. The student fills out a new hire form that requires additional input from the hiring department and from financial aid. Included on the new hire form is the name of the supervisor. I have a table that contains the supervisor name as well as email address. Once the student has filled out the new hire form, I would like to generate an email that sends a report, identifying the new hire, to the supervisor requesting them to fill in the missing information in the database. I want the email to either (1) be generated automatically once the student has completed the form selecting who to email to form the student input or (2) have the student pick the supervisor from a list to send the email to. I have very limited knowledge of programming. Thanks.

View 3 Replies View Related

Forms :: Using HTML To Format Body In Send Object Method?

Jun 26, 2014

Can I use html to format the message body in send object method ? If I can, how to do that.

View 5 Replies View Related

General :: Send Email Based On Query?

Apr 23, 2013

I have an access database that sends one e-mail to each individual in a table, that works fine. Now I would like to send an e-mail to the leaders of these individuals, however, some leaders have more than individual under their scope so to avoid sending several emails, I would like to know if there is any way I can send one e-mail to the person with the names of the individuals he leads in the body of the e-mail. This is the code I have that sends emails to the individuals:

Code:
Private Sub Command2_Click()
Dim MyDB As Database
Dim MyRS As Recordset

[Code]....

View 7 Replies View Related

Queries :: Send Query Result Via Email Attachment

Jul 25, 2013

I'd like to send a query result via email attachment daily without user intervention. Is it possible?

View 3 Replies View Related

Body Of Email

Nov 10, 2004

I'm wanting to use a cell from a table for the body of an email I am sending
I am trying to use the following code right now:

.Body =

but I'll change it if you have something better!
thanks

View 14 Replies View Related

Reports :: Send Email Based On Query From A Specific Form

Jun 27, 2013

I'm trying to send at report based on a Query from a specific form.

Everything is (almost) working fine, except the fact that I can't get a criteria into DoCmd.SendObject method.

My code is:

Private Sub Kommandoknap212_Click()
On Error GoTo MailTilGodkendelse_Err
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Dim MailAtt As String
Dim intSearch As String

[Code] ....

View 6 Replies View Related

Modules & VBA :: Generate And Send By Email Individual Reports Based On A Query

Mar 19, 2014

I am trying to make an automation in order generate reports based on query ( person name,person email address ) , export them to a folder in PDF and then send them one by one to each person email address.

What is happening:

- the reports are generated and exported fine
- the email are sent to the right addresses but the first person receives the correct report , the second person receives the report from the first person plus its own report and so on.

Here is my code :

Private Sub MakeReportSendEmail_Click()
Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Dim strSQL As String
Dim strRptName As String

[Code] ....

View 14 Replies View Related

General :: Automated Task - Send Email Address To All Emails In Query

Sep 30, 2013

I want to automate a task in access....

I have a query that may have 6 - 7 different records for example each record contains a different email address, i need to get the first email then send and email to that address then go to the next record get that email address send an email to that email address until its gone through all the records...

I use this code to send an email, dont know how to loop through records and get the email...

Code:
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim strPath As String
Dim strFileName As String
Set appOutLook = CreateObject("Outlook.Application")

[Code] .....

View 1 Replies View Related

Email HTML Body Code

Aug 27, 2015

I can create PDF's, DOCX's retaining the PDF formatting save them back to different network locations and then retrieve and attach to emails that are generated for different areas, however I have been asked to scrap the attachment and insert the content of the attachment directly into the body of the email. I have had a good browse around the net with no real approach. The code below simply gets the recepients email address adds the subject and then is looking for the .HTMLBody which simply comes through in the body as

"O:divAKLResgroupE - ReportsHTML FilesDRAFT TEST .html".

.To = RScoloumdetail(2) ' Gets Email Address
.CC = ""
.BCC = ""

[code]....

View 2 Replies View Related

General :: Send Outlook Email Based On List Of Emails In Access Query?

Sep 15, 2014

I've setup a selection form that returns a specific list of email addresses in a query.

What I can't work out is how to press a button and have the email addresses populate the To: field in a blank Outlook email - I don't need any bells or whistles.

View 8 Replies View Related

Bold Within Email Body Generated Within Access

Nov 21, 2006

Hey, I was wondering how I would tell Access to set bold on my email message. I use this code to generate the email:


Private Sub Email_Click()

strToWhom = [EMAIL]

strMsgBody = "This is my email body, I would like this word bold"

DoCmd.SendObject , , , strToWhom, , , "Subject", strMsgBody, True

End Sub

Thanks for any help provided.

View 2 Replies View Related

Forms :: Copying Data Into Email Body

Jan 30, 2015

I currently have a form with the below fields (example names)

FRMFormName001

Field001
Field002
Field003
Field004

RPTReportName001

Once the info is filled out we click a button that converts it into a report and once the information is confirmed correct you have to click another button Email it off, this is currently done by a macro creating the report as a attachment PDF File.

The system has now changed and they now want the details in the body of an Email, is it possible to make the details be copied straight into an Email body by a simple macro button click or similar?

View 5 Replies View Related

General :: HTML Body In Email Sent From Access

Sep 18, 2012

I have a database to send e-mails from access trough Outlook. The issue is that I would like the body of the e-mail to have hyperlinks, colours, bolds and that I can get it from plain text.

This is the code I have:

Dim MyDB As Database
Dim MyRS As Recordset
Dim MyTable As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

[Code] ....

How can I make the body to be HTML format, or, can I have a e-mail template storaged in my PC and then indicate to use it whenever the e-mail is sent?

View 4 Replies View Related

Forms :: Any Way To Export A Form Into Body Of Email?

Mar 31, 2014

I made a form in Acces now i want to make a button in that form that if a user click on it it wel open a new email message with the form in it.. so NOT if a attachement but directly in the email body.

I'm sure there is a way to do this true vba or something else...

View 1 Replies View Related

Modules & VBA :: Adding NameStr In Email Body

Jul 16, 2014

NameStr As String

I have made a name string

Now I would like to add the nameStr near "Dear " how can i do this?

strbody = "<H3><B>Dear [I want the placed nameStr here] </B></H3>" & _
bodyStr & _
"<br><br><B>Thank you</B>"

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved