shieldsco
asked on
Insert a table in the Body of Email from Access using HTML
I'm using the code below to generate emails from Access and I would like to insert an Access table in the body of the email. Can you give me example code to accomplish. Thanks
Dim objOutlook As Object, objEmailMessage As Object
Dim sSubj As String, sBody As String, sTo As String, strCC As String
Dim rs As dao.Recordset
Set rs = CurrentDb.OpenRecordset("t bl_FDA_No _Sig")
Do Until rs.EOF
sMail = sMail & ";" & rs("email")
rs.MoveNext
Loop
sMail = MID(sMail, 2)
Set objOutlook = CreateObject("Outlook.Appl ication")
Set objEmailMessage = objOutlook.CreateItem(0)
With objEmailMessage
.To = sMail
If strCC & "" <> "" Then
.CC = strCC
End If
.Subject = sSubj
'Set body format to HTML
.BodyFormat = olFormatHTML
'.To = "Your Mail"
.CC = "xxx@cdc.gov"
.Subject = "ISAs/MOUs Expected Signatures Dates"
.HTMLBody = "The OFSPO Team would like to follow up with you regarding the status of the following outstanding ISAs:."
.Display
' .send
End With
End Sub
Dim objOutlook As Object, objEmailMessage As Object
Dim sSubj As String, sBody As String, sTo As String, strCC As String
Dim rs As dao.Recordset
Set rs = CurrentDb.OpenRecordset("t
Do Until rs.EOF
sMail = sMail & ";" & rs("email")
rs.MoveNext
Loop
sMail = MID(sMail, 2)
Set objOutlook = CreateObject("Outlook.Appl
Set objEmailMessage = objOutlook.CreateItem(0)
With objEmailMessage
.To = sMail
If strCC & "" <> "" Then
.CC = strCC
End If
.Subject = sSubj
'Set body format to HTML
.BodyFormat = olFormatHTML
'.To = "Your Mail"
.CC = "xxx@cdc.gov"
.Subject = "ISAs/MOUs Expected Signatures Dates"
.HTMLBody = "The OFSPO Team would like to follow up with you regarding the status of the following outstanding ISAs:."
.Display
' .send
End With
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER