General :: Send Email Attachment Using Form Data Using Automation
Jun 20, 2013
I am currently using SendObj method to send an Outlook email and selected report as an attachment using the current form's data. This is triggered by a button click.
This is working well apart from having to use 'ClickYes' to outwit the Outlook 2012 security system.
However I now need to selectively send an extra pdf file with some of the emails based on a Yes/No field on the form. This is a fixed file on my local C drive.
I think I have to use automation to do that but I can't find a method of specifying the report I currently use in the SendObj method in the .Add.Attachment line.
Do I need to run the report and then save it so that I can specify the path and name in the .Add.attachment line followed by code which will delete the file? or is there a means of combining the code I currently use in SendObj to create the pdf object with automation option?
I have working code for both attachments at present but they send separate emails and I would prefer to combine them if possible.
View Replies
ADVERTISEMENT
Feb 12, 2013
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)
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] & "@abc.com")
View 3 Replies
View Related
Apr 9, 2014
I have Access 2007. I have a form where I can attach PDFs, Word documents, etc with an command button. This atachment is then put into a field in a table which has the email address and works fine.
The attachments are there in the field with the paper clip in the field title.I have a command button with an embedded macro that opens OUTLOOK and the email form with the email address and all the other information inserted perfectly. How do I get the OUTLOOK email to grab the assoiated attachment(s) from the record in the table and send them with the email? I can send the email without the attachment just fine.
The attachments cannot be located in a common path. They must be in the field in the associated record and each attachement will be different from one record to the next.
The emails are sent one by one, not as part of a group.
The form name is TASK DETAILS.
The email command buttin is called E-mail
The table is called TASKS
The attachment command buttin is called Attachments
What do I need to do this?
View 14 Replies
View Related
Feb 14, 2012
Send an email form Access code with attachment..
I am able to export data to excel file, I would like to send the excel file created to the customer, is there a sample code I can use to do this in a module.
View 1 Replies
View Related
Dec 8, 2006
I have the following code to send a email with outlook, what I need is to automatically collect a attachment named commissions located in C:document and settings/Documents/...
Private Sub cmdSendEmail_Click()
DoCmd.SendObject acSendNoObject, , , cboEmail.Value, , , "Commission Request", "A new commission request has been submitted."
End Sub
How can I do it??
Thanks
View 5 Replies
View Related
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
Jul 11, 2012
i have a filter that shows the bookings for the weekend, which i can click on each act and it generates an email for then to confirm. however some acts have more than one booking on that weekend and i want to be able to list the bookings in one email, the email script i use at the moment is below, the acts can be grouped by a field called grouped
Code:
Private Sub artist_DblClick(Cancel As Integer)
Dim msgTxt As Variant
Dim objOutlook As Outlook.Application
Dim objMailItem As Outlook.MailItem
[code]....
View 1 Replies
View Related
Jul 11, 2012
I want to copy the file stored on a attachment field (.jpg), so i can use it on a Word document as a picture.
I've tried it with bookmarks but no success:
' 'Paste the photo.
.ActiveDocument.Bookmarks("EidPhoto").Select
.Selection.Text = GetPath & "RE EIDPicture" & OwnerFullName & "_eid.jpg"
Then I only get the path of the file, Is there a control that i have to use?
View 1 Replies
View Related
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
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
Apr 20, 2012
I am trying to send out request-for-quote sheets to vendors and i need to send the image of the product as well. when i send emails for data collection, the attachment is not included. how can i attach images?
View 2 Replies
View Related
Jan 23, 2013
I need to create an email with an Access report attached as a PDF. I am using Access 2007 and Lotus Notes.If I use SendObject with acSendReport and acFormatPDF, it opens an email just fine but the attachment is created with some random letters and numbers and .tmp as the file name.
If I use Adobe Reader to open the attachment it displays correctly as a PDF, but I need the attachment name to be .pdf so it will automatically open with Adobe for the users.Is there a way to accomplish this with Lotus Notes? I have searched this forum and found some options for Outlook users, but not for Lotus Notes.
View 2 Replies
View Related
Jun 17, 2015
I have a database that has the table [tblAttachments] to store various attachments. In this table I have a primary key [ItemNumber] and an attachment data type field. This table holds all attachments for a Customer/Record.
What i am trying to accomplish is being able to code a command button to send the Attachment file (eg. various type of files .doc; .exl; .jpg etc) as an attachment in an email.
I have found some info on saving them to the local harddrive but this is not going to work for my specific needs.
View 14 Replies
View Related
Jul 9, 2014
I have a database that pulls images from a shared folder on our network with links. Is it possible to create a button to email the current record on a form and attach the file it references in the link?
The attachment is a pdf signature. I didn't want to include the files in the database for space issues.
I am using Access 2007. We out outlook as our email client.
View 1 Replies
View Related
Jun 11, 2015
I need a form that will send a email to certain contacts depending on which box is ticked
Have never done this previously would this be possible
View 2 Replies
View Related
Nov 7, 2012
I found the code below online and added it to a process I already use. It works great for what I need to do right now. The code opens the email with the email address, the file attached, and a message in the body. The only thing that is missing is the subject line, which is the month of the report.
It is a monthly report sent via a text file to another group. The form that I send this from has a table as the Control Source. The month is in that table. I can put it on the form and hide it so that it can be accessed. How to add that below so that the month would show up in the Subject Line of the email?
START OF CODE
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
'comment the next line if you do not want to see the outlook window
objMailItem.Display
[Code] ....
View 6 Replies
View Related
Apr 17, 2014
I have a marco that sends a report to other users, is it possible to stop the same report being sent twice to the same person . the user who sends the report is prompted for a number for that specific report...
View 2 Replies
View Related
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
Jun 18, 2015
Ive recently developed in Emailing from Microsoft Access. When I was researching email methods from Access a thought occurred to me that there should be an A.P.I. that would do this the easy way.All of them did have a web A.P.I. which was all I needed to translate a web request from the other language examples given.
Code:
Dim reportName As String
Dim path As String
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Dim strAttachments As String
Dim strTransPort As String
Dim byteData() As Byte
[code]....
View 5 Replies
View Related
Aug 30, 2013
How can I make that my access send an email to a user if there 7 days until en employee's birthday.
View 5 Replies
View Related
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
Sep 17, 2014
I have a requirement to send a email to individual clients via my access database 2003 . I am using the email address of the client in the current open form . I then created a query using the id to filter that particular client, this query then becomes my record set.The content for the email is held in a .txt file , On my c drive . Every things appears fine however the fonts that I select in the .txt file are not being use in the actual email body. I created a word document with my preferred fonts and copied and pasted them into the .txt file but on sending the email the selected fonts do not appear.
I have attached a demo of what I am trying to do . To test enter your own email in the email address field of the form . Note the .txt file is on the C:/ drive.
View 4 Replies
View Related
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
Nov 9, 2012
I am sending an email using SendObject. Sometimes it works, and sometimes it makes the computer freeze up with no error message. I have tried this with Outlook running or not running, seems to make no difference.
Code:
'The sub procedure below sends e-mail in response to a click on the Send button.
Private Sub SendMessagesButton_Click()
'For Access, define some object variables and make connections.
Dim myConnection As ADODB.Connection
Set myConnection = CurrentProject.Connection
Dim myRecordSet As New ADODB.Recordset
myRecordSet.ActiveConnection = myConnection
[Code] ....
I have added some MsgBox () to narrow down where it crashes. It is after 'Five' and Before 'Six'. On the line:
Set appOutlookRecip = .Recipients.Add(eMailAddress)
I am mystified as to why it works OK sometimes, and not others. The email address being used is valid.
View 2 Replies
View Related
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
Feb 11, 2013
I have a split form that can be filtered with a combo box. It filters out all "counties" and then shortens the list for me. Now I have the following code attached to a Send E-mail button:
Code:
Dim oOutlook As Object
Dim oMail As Object
Dim strAddr As String
Dim MyDB As DAO.Database
Dim rstEMail As DAO.Recordset
[code]....
How do I have the recordset open only the filtered recordset and not the entire table?
View 1 Replies
View Related