Solved

Attach a PDF that was attached to access into an email

Posted on 2014-02-05
1
583 Views
Last Modified: 2014-02-19
I have this database I am creating.   Its set up to add an email with a report to an email.  There are two thigns missing.   I need the subject of the email to automatically merge from the tblBodyTemplate email.  And I need the attachment from that same table to also go into the email.  Is that possible how so?  I attached a sample to see what I am referring to.
1.accdb
0
Comment
Question by:lehi52
1 Comment
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39838452
You can dump an item stored in an Attachment field to disc and work with it from there:
Dim rst As DAO.Recordset
 Set rst = Currentdb.OpenRecordset("SELECT * FROM YourTable WHERE YourID=" & Me.YourID
 Dim rstAttachment AS DAO.Recordset
 Set rstAttachment = rst.Fields("YourAttachmentField").Value
 rstAttachment.Fields("FileData").SaveToFile "Path to save"
 
However, as we've told you in your other question, once you do that you cannot use SendObject to attach it. You must automate your email client, and I believe you're using Lotus Notes, and I also believe the "attaching to my email" part was answered here:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28353413.html

Also, here's a good link on working with the Attachment files in VBA: http://msdn.microsoft.com/en-us/library/office/bb258184(v=office.12).aspx
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question