Sub attachment()
Dim strlocation As String
Dim outapp As Object
Dim outmail As Object
Dim strbody As String
Set outapp = CreateObject("outlook.application")
Set outmail = outapp.createitem(0)
strlocation = "C:\Users\varun.vashisht\Desktop\New folder\Raw Sheet.xlsm"
strbody = "Hi there" & vbNewLine & vbNewLine & _
"Thanks for visiting" & vbNewLine & _
"For your kind" & vbNewLine & _
"Will meet you" & vbNewLine & _
"Thanks & Regards"
With outmail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Training Structure"
.Attachments.Add (strlocation)
.display
End With
Set outmail = Nothing
Set outapp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Option Explicit
Sub attachment()
Dim strlocation As String
Dim outapp As Object
Dim outmail As Object
Dim strbody As String
Set outapp = CreateObject("outlook.application")
Set outmail = outapp.createitem(0)
strlocation = "C:\Users\varun.vashisht\Desktop\New folder\Raw Sheet.xlsm"
strbody = "Hi there" & vbNewLine & vbNewLine & _
"Thanks for visiting" & vbNewLine & _
"For your kind" & vbNewLine & _
"Will meet you" & vbNewLine & _
"Thanks & Regards"
With outmail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Training Structure"
.Body = strbody '<<<---------<<<<<<<<<<<<
.Attachments.Add (strlocation)
.display
End With
Set outmail = Nothing
Set outapp = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
[\Code]