Sub SendReports(DisplayMsg As Boolean)
Dim objOutlook As Object
Dim objOutlookMsg As Object
Dim strTo as String
Dim strSubject as String
Dim strBody as String
Dim strAttach as String
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(0)
strTo = "xxxx"
strSubject = "yyyy"
strBody = "XXXX"
strAttach = path & filename
With objOutlookMsg
.To = strTo
Subject = strSubject
.Body = strBody
.Attachments.Add strAttach
.Save
.Open
End With
Set objOutlook = Nothing
End Sub
|