Link to home
Start Free TrialLog in
Avatar of shieldsco
shieldscoFlag for United States of America

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("tbl­_FDA_No_Sig")

Do Until rs.EOF
     sMail = sMail & ";" & rs("email")
    rs.MoveNext
Loop

sMail = MID(sMail, 2)





Set objOutlook = CreateObject("Outlook.Application")
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
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of shieldsco

ASKER

Thanks