The following code works great for me to send an email file from Excel to Outlook automatically. However, I want to add a body to the message and cannot figureout where and how to add it to this code. Let's say for example, that I want to say "See attached." How would I add this? I tried .body = "See attached." but this is not working.
![]()
Sub Relay() 'Working in 97-2010 Dim wb As Workbook Dim I As Long Set wb = ActiveWorkbook If Val(Application.Version) >= 12 Then If wb.FileFormat = 51 And wb.HasVBProject = True Then MsgBox "There is VBA code in this xlsx file, there will" & vbNewLine & _ "be no VBA code in the file you send. Save the" & vbNewLine & _ "file first as xlsm and then try the macro again.", vbInformation Exit Sub End If End If On Error Resume Next For I = 1 To 3 wb.SendMail "Jarret Test", _ "System Discharge Report" If Err.Number = 0 Then Exit For Next I On Error GoTo 0 End Sub
Bookmarks