Here is what is going on. I use a series of RecordSets to extract certain data that needs to be sent to managers every week. Once compiled, it is going into a TEMP table.
I want to send that temp table as an attachment on an Outlook message. I know I don't have the right syntax for setting the attachment, and have now found the right one.
Am I even close? Do I need to export the table to Excel before attaching? And what would be the syntax then?
Alan
![[smurf] [smurf] [smurf]](/data/assets/smilies/smurf.gif)
I want to send that temp table as an attachment on an Outlook message. I know I don't have the right syntax for setting the attachment, and have now found the right one.
Code:
' once tmpTable filled ~ DO THE EMAIL THING HERE
Debug.Assert False
With oMail
MsgBody = "<p>The attached spreadsheet indicates employees that are indicating unApproved"
MsgBody = MsgBody & " hours in the period " & Starts & " through " & Ends & ".</p><p>Please review and correct.</p>"
.BodyFormat = olFormatHTML
.HTMLBody = MsgBody
.Subject = "Not Approved hours week ending " & Ends
.ReminderSet = True
.Attachments.Add = "tblApprvExport" 'NOT WORKING
.Recipients = RS!LowestMgrName 'Mgr
.Recipients.ResolveAll
.Display = True 'Show email before sending
End With
NoRecords:
MgrSet.MoveNext
Debug.Assert False
Loop
Am I even close? Do I need to export the table to Excel before attaching? And what would be the syntax then?
Alan
![[smurf] [smurf] [smurf]](/data/assets/smilies/smurf.gif)