Sub add_Attachment_to_email()
Dim strLocation As String
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strLocation = "C:\Users\welcome\Desktop\ap.txt" ' Specify your own file name with path
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Mail with Attachments" ' Specify your Subject line
.Body = "Check More Codes in VBA Useful Codes Android App!" ' Specify your body text
.Attachments.Add (strLocation)
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
VBA Outlook KPI Excel Alt+F11 Dashboards Macros Recording Graphs Automation Developer WaterFall Powerpoint Charts Pivot Tables Forecast Charts