Bill,
Thanks for the reply. This is more than enough for me. I think this is a bit over my head and more than I need.
At this point I create a report and turn it into a .pdf and attach it to an email.
Thanks for your time.
Bill
Bill Singer
Office 365
Minnesota
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Monday, February 26, 2018 4:25 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Copy Paste
Bill - Sorry this has gone unanswered. I thought I posted a reply the day you posted. While this is not an exact how-to I hope it is enough for you to get started.
I use a table called EmailTemplate with 3 fields:
NoticeName text(50)
HTMLTemplate Memo
SubjectLine Text(50)
I wrote the HTML to be used as the body of the email and put bracketed placeholders for each field. HTML is below.
Then I open a recordset for the template I want. That should return only the one record that has the template you want. Then use Replace() to put the strings where they belong. In this case the only placeholder is [TFirstName].
Dim db As DAO.Database
Dim rsTemplate As DAO.Recordset
Dim strSQL As String
Dim strHTLMTemplate As String
Set db = CurrentDb
strSQL = "SELECT NoticeName, HTMLTemplate, SubjectLine " _
& "FROM EmailTemplate " _
& "WHERE NoticeName = '" & conNoticeName & "'"
Set rsTemplate = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
'Put the HTML into a string variable
strHTLMTemplate = rsTemplate!HTMLTemplate
strHTLMTemplate = Replace(strHTLMTemplate, "[TFirstName]", strToFName)
From there, you can put strHTMLTemplate into the body of your email. See my code sample for emailing at http://www.thatlldoit.com/Pages/codesamples.aspx
<html>
<head>
<title></title>
</head>
<BODY>
<P>Welcome aboard, [TFirstName].</P>
<P>You now have an account in the Application Master System and will need to take a few steps to install it.</P>
<P>Click this link to install the Application Master System: <a
href="file:///\\SAN01\Department\IS\AppMasterSystem\AppMasterSystem_FEUpdate.vbs">Application Master System Installer</a></p>
<p>The installer will download all the files, put a shortcut on your desktop and
open the application. The shortcut looks like this: </p>
<p><img border=0 alt="" align=left
<p> </p>
<p> </p>
<p> </p>
<p>The Installation will open a small window telling you the application is loading. If you get any prompts to over-write or copy & save click yes.</p>
<p>Depending on your MS Access version and settings you may get warnings or error messages when the application opens. If you get any of these please call me so I can remote to your computer and correct the settings. This should only take a minute or two.</p>
</BODY>
</html>
Regards,
Bill Mosca, Founder - MS_Access_Professionals
My nothing-to-do-with-Access blog
---In MS_Access_Professionals@yahoogroups.com, <Bill.Singer@at-group.net> wrote :
In MS Access Office 365 I have a form that contains about 9 pieces of information that my customers frequently request. I created a small report in hopes of doing a COPY -PASTE and putting the information in an email. That would be fast and easy.
The COPY-PASTE idea did not go well. The underlying query was pasted into my report.
I could export as a PDF but I would really like to just PASTE the information into an email.
Any thoughts
Bill Singer
Andover, MN
Posted by: "Bill Singer" <Bill.Singer@at-group.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar