Solved

Attach a PDF that was attached to access into an email

Posted on 2014-02-05
1
580 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

932 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now