?
Solved

Attach a PDF that was attached to access into an email

Posted on 2014-02-05
1
Medium Priority
?
593 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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