Solved

Using Email Templates and populating Bookmarks from Access

Posted on 2008-10-02
9
1,017 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
[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
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

734 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