Send Report From Access In A Body Of An E-mail
Dec 13, 2006Could 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 RepliesCould 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 RepliesI have a ms access table with two fields...tablename is ..."Addresses"..
Field1:= Employee_mail_id
Field2:= Leave_balance
What I need to do is that,I need to send individual mail (in Bulk) two each employee intimating their leave balances.
Is it possible to do it in vb .I want it to assign the codes in a button.
Below iss the code.
Dim r As Recordset
Dim email As String
Set r = CurrentDb.OpenRecordset("select * from Addresses")
Do While Not r.EOF
email = email & r(2) & ";"
r.MoveNext
Loop
r.Close
DoCmd.SendObject acSendNoObject, Null, Null, email, Null, Null, "Test subject", "Message body of the test letter", False, Null
I am trying to send an MS Access 'report' as an attachment to a mail recipient in rtf format without success. Everything seems to work fine except the 'send' button. Click away and nothing happens.... no error messages, no nothing. Any suggestions or tips on how to make this work?
Thanks...
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?
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".
Is there a way to paste a access query result in the outlook message body?. I do not want to attach the query result in the email.
View 8 Replies View RelatedI have a script that sends a mail using outlook to a different person depending on a value in a field. I want to add values from fields to the subject and body of the mail it creates. This is what I have so far:
Function Mail()
On Error GoTo Mail_Err
If (Forms![Manage Packages]![Customer] = "MSC") Then
DoCmd.SendObject , "", "", "email", "email", "", "[ID] - [Package Name] - Delivered", "Dear," & vbNewLine
[Code] .....
In the subject and body the field ID's I want to add are marked as [ID], [Package name] etc.
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] ....
Access 2010 - add report to body of an email
i have VBA code to create an email and attach an excel file, what i would like is code to add a report called REPORTMISSINGDATES to the body of the email.
this is the code i have so far, which works and adds everythng i wqant except the main body of the email.
Private Sub Command31_Click()
On Error GoTo Command31_Click_Err
Dim Email As String
Dim name As Variant
Dim EMPloy As Variant
Dim month As Variant
month = MonthName([Forms]![STAFFATTENDANCEMenu]![StaffMonth])
EMPloy = Forms!staffattendancezone!Staff
name = DLookup("[STAFFNAME]", "[QRYSTAFFNAME]", "[ASA] = Forms!staffattendancezone!Staff")
Email = (Forms!STAFFATTENDANCEAdjust!Email)
DoCmd.SendObject acQuery, "STAFFATTENDANCEZONECheckEmployee", "ExcelWorkbook(*.xlsx)", [email], "", "", "" & "Attendance Errors", "THIS IS WHERE I WANT THE REPORT TO GO" _
End Sub
Can I use html to format the message body in send object method ? If I can, how to do that.
View 5 Replies View RelatedI 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] .....
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"...
I send mail massage with the code
DoCmd.SendObject , , , strToField, , , strSubject, strMessage, False
and the access ask me the file attach
how can I send automateclly with no msgbox
I would like to have a button on a form, against each record that has been entered onto the form and once the button has been clicked on, an e-mail would be automatically be generated with the contents of particular fields and automatically sent to a pre designated e-mail address.
Is this possible, if so and help would be most appreciated.
Many thanks in advance
I am trying to use the cmd.sendobject to send an e-mail to a specific e-mail address after clicking on a button on a form.
This works fine but send all the records within a form or report but I would only like to send a specific record not all of them.
The form is a continuous form.
Many thank in advance!.
I have been searching the forums about how to send an email using a mail merge Word document with attachments and have not found a way to accomplish this. There are numerous posts on haw to send email using the SendObject function with attachments but I really need to use a Word mail merge to satisfy the requirements set forth by my superiors.
The database uses a query to pull the list of recipients. The query contains the name, email address and a few other informational items that need to be put in mail merge. I also need to attach a second 5 page Word document. At this point, I dont care if I have to deal with the Outlook security or not, I only have about 20 a day to send but if there is a way to get around it, that would be cool.
Would it be possible to create a Report that looks the same as the mail merge document and send it to each of the recipients from the query and attach the document to that email?
I am running up against a deadline that is fast approaching and any help would be greatly appreciated.:(
I've got one of my users which has just started getting the "Can't send this e-mail message" error. Found reference to it being trying to send an email without editing (MS article 884998. My editmessage is set to yes so I know it is not this exact problem but just wondering if anyone else had has this type of issue before and could they get around it?
I tried searching but with such common words it wouldn't return any results.
In Access 2007 there a way to send a report to a file you create from the information in the form?
Right now my code for the command button is:
Dim strMyPath As String
Dim strMyName As String
strMyPath =" EBEBMainDigital Sender "
strMyName = "Permit " & Me.[Permit Number].Value
DoCmd.OpenReport "File Current Permit", acViewPreview, , "[ID] = " & Me.[ID]
DoCmd.OutputTo acOutputReport, "File Current Permit", acFormatPDF, strMyPath + strMyName, False
DoCmd.Close acReport, "File Current Permit"
And that works perfect for sending the current report to the Digital Sender Folder... but I'd like to be able to send it to a certain county folder within the digital sender folder, based on what is listed for the county on the form. same for municipalities. and then, have it create a folder based on the name inside the form..... how to lead it through the path of the folder through the given information on the form, or how to make it create a folder.
I am trying to work my way into putting the content of my report into the body of an e-mail. I have used the following code to do so but I keep on getting the error: "An Expression You Entered Is the Wrong Data Type for one of the Arguments"
Code:
Private Sub Command278_Click()
On Error GoTo ER
Dim db As Database
Dim rstOpenPurchaseOrders As Recordset
Dim strSQL As String
[Code] .....
With this very simple command, I have the ability to send emails to several clients, reporting many things, quotations etc.
Private Sub Command84_Click()
DoCmd.SendObject , , , , , , "SOMETHING", [SalesGroupingField] & "" & [1], True, ""
End Sub
Now, i want, on the body of the emai, to display many records, it is from Nothwind, how can i display on the body of the email all records from this report?
I have copied a VBA from the net and it is working fine and producing my report on outlook body text but one problem me facing is that it is pasting only first page if the second page is there it is not coming in outlook text body this what i want rest every thing is correct the code is:
Private Sub Command88_Click()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem
[Code] .....
Hi, this is probably a very easy question for you Access-gods out there.
Ive made a database (MS Access 2000) with all my clients. I collect a lot of contact info, including e-mail.
I want to make a function which opens a new mail window (Outlook 2003) and automatically puts in the e-mail from my form (In the send-to field of outlook).
Is this possible? And how?
(BTW: Im a newbie with VBA)
I'm running the following code to generate an email from a report.
Quote:
Function ExportHTML3()
Dim strline, strHTML
Dim OL As Outlook.Application
[Code].....
But I don't really know much VBA and I found that code on the internet, so I can't figure out how it's doing that and if I can stop it. Or is there another way to get the text from the HTML file into the Email body, which brings the bold formatting with it, like the following.
Incident Reference: AA99999
hi,
at present i have an order form. this form has a id number and supplier field . at the moment a macro runs a report which produces the order. the macro does ask me for the order number. the order number is the id number, what i would like to do is get a macro that looks at the id field and supplier field, fetch the e-mail address from the supplier table and send the order to the e-mail address
thanks
steve
I am wondering if it is possible to send a report as xls file and keep the format exactly as the report looks.When I try to send it now, it automatically changes back to the column names from the table, which I in the report have changed and want to keep in my excel output!
View 3 Replies View RelatedHey, 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.