gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
I have this code that works well.
is there a way to change the "To" address to the value in a cell within the workbook?
Sheets("Supplier").Range("E8")
Also curious if its possible to a row in the body that would come from a value in a cell.
Thanks for the help!
is there a way to change the "To" address to the value in a cell within the workbook?
Sheets("Supplier").Range("E8")
Also curious if its possible to a row in the body that would come from a value in a cell.
Code:
Sub GenerateEmail()
'Create Email
If Sheets("Supplier").Range("E8").Value <> "" Then
With CreateObject("outlook.application").createitem(0)
.To = "QuoteFiles@drs.com"
.CC = ""
.BCC = ""
.Subject = "Leonardo DRS - Open PO Status Request. Please Complete the attached and Return ASAP"
.body = "Attched please find Leonardo DRS - NIS PO Status Report. We formally request you complete the attached Template (Tab: PO Status)and return it to the sender as soon as possible. If you have any questions, please contact the sender. We thank you for your continued support"
.attachments.Add ThisWorkbook.FullName
.display
End With
Else
MsgBox " It appears that you did not list a Contact Email address in E5"
Sheets("Supplier").Range("E8").Select
End If
End Sub
Thanks for the help!