This is the way i was thinking, however it will be used over a large network so the temp file will be created in different places depending on the workstation/user.
I have found this but like the title of my thread says its a bit too advanced for me !!
Public Function HtmlNoReportEmail(strTblQryName As
String)
Dim olApp As Outlook.Application
Dim objMail As
Outlook.MailItem
Dim strMsg As String
Dim sqlString As String
Dim i As
Integer
Dim rowColor As String
Dim rs As ADODB.Recordset
Set rs =
New ADODB.Recordset
sqlString = "SELECT * FROM " & strTblQryName
& ""
rs.Open sqlString, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic
strMsg = "<table border='1' cellpadding='3'
cellspacing='3' style='border-collapse: collapse' bordercolor='#111111'
width='800'>" & _
"<tr>" & _
"<td
bgcolor='#7EA7CC'> <b>Company</b></td>" &
_
"<td bgcolor='#7EA7CC'> <b>Last
Name</b></td>" & _
"<td
bgcolor='#7EA7CC'> <b>First Name</b></td>" &
_
"<td bgcolor='#7EA7CC'> <b>Job
Title</b></td>" & _
"<td
bgcolor='#7EA7CC'> <b>Business Phone</b></td>"
& _
"<td
bgcolor='#7EA7CC'> <b>City</b></td>" &
_
"</tr>"
i = 0
Do While Not rs.EOF
If (i Mod 2 = 0) Then
rowColor =
"<td bgcolor='#FFFFFF'> "
Else
rowColor = "<td
bgcolor='#E1DFDF'> "
End If
strMsg = strMsg &
"<tr>" & _
rowColor & rs.Fields("Company") & "</td>"
& _
rowColor & rs.Fields("Last Name") & "</td>" &
_
rowColor & rs.Fields("First Name") & "</td>" &
_
rowColor & rs.Fields("Job Title") & "</td>" &
_
rowColor & rs.Fields("Business Phone") & "</td>" &
_
rowColor & rs.Fields("City") & "</td>" &
_
"</tr>"
rs.MoveNext
i = i + 1
Loop
strMsg =
strMsg & "</table>"
Set olApp = Outlook.Application
Set
objMail = olApp.CreateItem(olMailItem)
With objMail
.BodyFormat = olFormatHTML
.HTMLBody =
strMsg
.Recipients.Add "user@email.com"
.Subject = "Customer
Data"
'.Send if you want to send it directly without displaying on
screen
.Display
End With
Set olApp = Nothing
Set objMail = Nothing
End Function