If you create an outlook template, there is not a lot to change?
You could have the .to, .subject all set in the template?
All you would literally do is replace each placemarker with one of those values IN CODE!!! and just send the email?
You were creating the outlook email from access in the first place? Access does not create emails, it always uses another program.
That link I posted shows you how to create a new email from a saved template.
Here is how I did it in one of my emails.
However I did not bother with fancy lines/boxes. I have always been more concerned on function rather than cosmetics.
Code:
' Set up HTML tags
strPad = "<tr><td>"
strEndPad = "</td></tr>"
strPadCol = "</td><td>"
strBlankLine = "<tr></tr>"
' Now add the variable data
With objOutlookMsg
.HTMLBody = .HTMLBody & strPad & str3rdPartyType & strPadCol & str3rdParty & strEndPad
.HTMLBody = .HTMLBody & strPad & strDatetype & strPadCol & strDate & strEndPad
.HTMLBody = .HTMLBody & strPad & "Method:" & strPadCol & strMethod & strEndPad
.HTMLBody = .HTMLBody & strPad & "Reference:" & strPadCol & strRef & strEndPad
.HTMLBody = .HTMLBody & strPad & "Amount:" & strPadCol & strAmount & strEndPad
.HTMLBody = .HTMLBody & strPad & "Balance:" & strPadCol & strBalance & strEndPad
' Add any notes if they exist
If Len(strNotes) > 0 Then
.HTMLBody = .HTMLBody & strPad & "Notes:" & strPadCol & strNotes & strEndPad
End If
' ' Add blank line for next set
.HTMLBody = .HTMLBody & strBlankLine & strBlankLine
End With
Here is how I did it in one of my emails.
However I did not bother with fancy lines/boxes. I have always been more concerned on function rather than cosmetics.
Code:
' Set up HTML tags
strPad = "<tr><td>"
strEndPad = "</td></tr>"
strPadCol = "</td><td>"
strBlankLine = "<tr></tr>"
' Now add the variable data
With objOutlookMsg
.HTMLBody = .HTMLBody & strPad & str3rdPartyType & strPadCol & str3rdParty & strEndPad
.HTMLBody = .HTMLBody & strPad & strDatetype & strPadCol & strDate & strEndPad
.HTMLBody = .HTMLBody & strPad & "Method:" & strPadCol & strMethod & strEndPad
.HTMLBody = .HTMLBody & strPad & "Reference:" & strPadCol & strRef & strEndPad
.HTMLBody = .HTMLBody & strPad & "Amount:" & strPadCol & strAmount & strEndPad
.HTMLBody = .HTMLBody & strPad & "Balance:" & strPadCol & strBalance & strEndPad
' Add any notes if they exist
If Len(strNotes) > 0 Then
.HTMLBody = .HTMLBody & strPad & "Notes:" & strPadCol & strNotes & strEndPad
End If
' ' Add blank line for next set
.HTMLBody = .HTMLBody & strBlankLine & strBlankLine
End With
OK, thanks to all the people that helped me here and also all the people in this forum to keep so much valuable information for others to reach and learn from it I was able to figure out the html table in the email report. I will share my results below
The body looks like this
and here is the code I was able to figured out that worked perfectly for me.
OK, thanks to all the people that helped me here and also all the people in this forum to keep so much valuable information for others to reach and learn from it I was able to figure out the html table in the email report. I will share my results below