Youseepooo
New Member
- Joined
- Feb 5, 2019
- Messages
- 37
Hello,
With some help from a fellow forum user i have this code:
1) The issues are i want it to save the file name as "x" which is tomorrows date and save it in a network shared folder.
2) i also want to include a image for my company logo after my position. in the body of the email which i highlighted in blue.
Thank You Very Much!!!
With some help from a fellow forum user i have this code:
1) The issues are i want it to save the file name as "x" which is tomorrows date and save it in a network shared folder.
2) i also want to include a image for my company logo after my position. in the body of the email which i highlighted in blue.
Thank You Very Much!!!
Sub Send_Email()
Dim wPath As String, wFile As String
Dim x As Date
x = Format(Now() + 1, "MMMM dd, yyyy")
wPath = ThisWorkbook.Path
wFile = "Daily Look Ahead.pdf"
Range("B1:I47").ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPath & wFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Set dam = CreateObject("Outlook.Application").CreateItem(0)
'
dam.To = "ymussa@gmail.com"
dam.cc = "jsilko@gmail.com"
dam.Subject = "Daily Schedule for " & x
dam.body = "Hello all," & vbNewLine & vbNewLine _
& "The Daily Look Ahead Schedule for " & x & " is attached." & vbNewLine & vbNewLine & vbNewLine & vbNewLine _
& "Thank You" & vbNewLine & "Name" & vbNewLine & "Position" & vbNewLine & "Test Sent with VBA"
dam.Attachments.Add wPath & wFile
dam.Send
MsgBox "Email sent"
End Sub