Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1070
  • Last Modified:

Using Email Templates and populating Bookmarks from Access

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
stillers1994
Asked:
stillers1994
  • 5
  • 4
1 Solution
 
Jeffrey CoachmanCommented:

"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
 
stillers1994Author Commented:
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
 
Jeffrey CoachmanCommented:
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
stillers1994Author Commented:
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
 
Jeffrey CoachmanCommented:
Then please explain in detail what you mean by "customise".

AFAIK, you can use this:
.body=[YourCustomBodyField]
0
 
stillers1994Author Commented:
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
 
Jeffrey CoachmanCommented:
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
 
stillers1994Author Commented:
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
 
Jeffrey CoachmanCommented:
Great.

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

JeffCoachman
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now