Solved

Using Email Templates and populating Bookmarks from Access

Posted on 2008-10-02
9
1,002 Views
Last Modified: 2013-11-27
Deep breath and time for my first question on E-E
I am developing a database in Access 2007. I would like to be able to select data from the db and use it to populate bookmarks in an Outlook Template. Is this possible. I have managed to send straightforward emails from Access and have previously managed to populate a Word document from Access using bookmarks. I would now like to use an email template and somehow customise it with data from the db. Is this possible? If so are there any useful code snippets to help me. I currently use VBA and open an instance of MS Outlook to send emails.

Many thanks
0
Comment
Question by:stillers1994
  • 5
  • 4
9 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22633910

"Outlook Template"
Which kind please?
Email?
Contact?
Meeting?
Appointment?
Note?

Are you asking, or do you know for a fact that Outlook objects even have a .Bookmark property?

JeffCoachman
0
 

Author Comment

by:stillers1994
ID: 22634117
Sorry - about lack of info
I have only just started using things like Bookmarks. I used them to successfully populate a Word Doc from Access 2007 with items from the DB (using vba). So I then looked in Outlook  2007 at Email Templates,  and saw that you can similarly add bookmarks to the .oft template so my question is can you use vb code to open the email template from Access using vb code, and populate the bookmarked items before sending out the email.
I hope that makes sense
Many thanks
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22634496
stillers1994,

You can "Populate" the email fields by using the fairly standard code found here:
http://support.microsoft.com/kb/161088

For example , you would simply substitute:
              Set objOutlookRecip = .Recipients.Add([YourEmailRecipientField])
For
              Set objOutlookRecip = .Recipients.Add("Nancy Davolio")

Similarly to fill in a subject into the email, form an Access field use:
             .Subject = [YourSubjectField]
...Instead of
             .Subject = "This is an Automation test with Microsoft Outlook"


This is the standard way of doing this, so I can't really see the need for "bookmarks" per se.
;-)

JeffCoachman
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:stillers1994
ID: 22634668
Thankyou for your quick reply.
 I know I can add the recipient, subject etc but what  I actually wanted to do customise is the actual .body part  of the email.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22634903
Then please explain in detail what you mean by "customise".

AFAIK, you can use this:
.body=[YourCustomBodyField]
0
 

Author Comment

by:stillers1994
ID: 22635058
I would like to set up a 'pretty' email that will be sent out to customers, and within this email, I would like to drop in personalised information concerning for example particular project information and product details. Now I could set up a Word document and drop this info into the bookmarks and then email this as an attachment but I would prefer to use the email body itself rather than have someone have to open an attachment.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 22635581
stillers1994,

Then you can use the .HTMLBody property.

Using this you can insert HTLM formatted text, or an image into an email body.

For example:
        .HTMLBODY = "<HTML><b><u>ADDRESS</b></u><br></br>123 broad street<br></br><br></br></HTML>"

Insert an image:
  <img SRC=C:\File.jpg>

JeffCoachman
0
 

Author Closing Comment

by:stillers1994
ID: 31502364
Yes that will do it - would have preferred using a kind of Email template with 'drop in fields' that could be maintained by someone else but this method will do for now. Many thanks for your help
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22657916
Great.

Besides this site, here is a site that is totally dedicated to Outlook/Exchange.
http://www.outlookcode.com/

JeffCoachman
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Question about Exchange Calendar Updating 3 35
Access Update Query 1 20
Column Layout in Access Xp VBA Report 3 19
backup programme - VBA 3 24
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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