Solved

Attach a PDF that was attached to access into an email

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

707 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

16 Experts available now in Live!

Get 1:1 Help Now