EmailDatabaseObject content as bodytext of email

Nearly there - you need to escape your fields from the HTML code string. Each row should read something like;
Code:
 "<tr><td>Company Name</td><td>" & Me.companyname & "</td></tr>"
 
Code:
<table width="25%">
<style>
th { color:#FFFFFF; background-color:#000066 }
td { vertical-align:top; align:left; background-color:#CCCCCC }
</style>
  <tr>
    <th align="left">Company Name</th>
    <td>Me.companyname</td>
  </tr>
  <tr>
    <th align="left">Name</th>
    <td>Me.forename</td>
  </tr>
  <tr>
    <th align="left">Address 1</th>
    <td>UseAddress1</td>
  </tr>
  <tr>
    <th align="left">Postcode</th>
    <td>Me.UsePostcode</td>
  </tr>
  <tr>
    <th align="left">Home Tel</th>
    <td>Me.TelephoneH</td>
  </tr>
  <tr>
    <th align="left">Source</th>
    <td>Me.source</td>
  </tr>
  <tr>
    <th align="left">Mobile</th>
    <td>TelephoneM</td>
  </tr>
  <tr>
    <th align="left">Reference</th>
    <td>Me.CLIENTREFuser</td>
  </tr>
</table>
 
I'm afraid I'm lost on this!!
My lack of html is quite apparent unless somebody leads me up the garden path holding my hand.
 
You'll need to take the plunge with the html. Arne's code is a little out I think, as he seems to have multiple TH (Table headings) which is not right.

Based on what you posted earlier I think you want something like (Untested)
Code:
Variable_Body = "<style> " & _
     "p {font-size:12pt; font-family:Calibri}" & _
     "</style>" & _
     "<p>" & Me.Greet & "," & "</p>" & _
        "<table >" & _ 
	"<tr><th colspan='2'>Your Heading in here</th>" & _
	"<tr><td>Company Name:<td>" & Me.companyname & _
	"<tr><td>Name:<td>" & Me.forename & _
	"<tr><td>Address 1:<td>" & Me.UseAddress1 & _
	"<tr><td>Postcode:<td>" & Me.UsePostcode & _
	"<tr><td>Home Tel:<td>" & Me.TelephoneH & _
	"<tr><td>Source:<td>" & Me.source & _
	"<tr><td>Mobile:<td>" & Me.TelephoneM & _
	"<tr><td>Reference:<td>" & Me.CLIENTREFuser & "</table>"
 
already tested my last post.
and the result is same as the OP want, row-wise.
 
already tested my last post.
and the result is same as the OP want, row-wise.
Apologies Arne, I mainly use HTML tables in automated SQL Server emails, which are a little simpler to play with, and was trying to adapt their layout.
 
Thanks Minty, that's just the "visual" that I wanted. Many thanks to all and your persistence. It certainly give others the ability to edit the code to their needs. html homework for me.
 

Users who are viewing this thread

Back
Top Bottom