It's such a long time since I did anything like this and can't find any examples I have used before.
Send current record via email in the body ( not as attachment)
Here's my uncomplete code, could just do with the current record bit if possible:
Code: Select all
Private Sub cmdSendToEmail_Click()
Dim olApp As Object
Dim olMail As Object
Dim strBody As String
[b]'strBody = ??? NEED THIS TO ENTER THE CURRENT RECORD IN THE BODY, EACH FIELD ON A NEW LINE vbCrLf
'Table is "tblRework"
'Fields are [ReportDate], [JobID], [FaultReported], [WhoDealtWithThis], [ResolveOutcome][/b]
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.createitem(0)
With olMail
.To = "dave.willett@someemail.com"
.Subject = "Test Subject"
.Body = strBody
.Display
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub