Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using Email Templates and populating Bookmarks from Access

Posted on 2008-10-02
9
Medium Priority
?
1,054 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

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 1500 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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