Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Attach a PDF that was attached to access into an email

Posted on 2014-02-05
1
Medium Priority
?
599 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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…

618 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