I have a multisheet workbook posted on the network which managers use to request ID's for new hires. I have it set up to send me an email when they hit a 'submit' button.
Currently it fills the subject line of the email with a static value that I've entered into the code. The problem is that I have dozens of these in my email and it's a mess trying to keep track.
I would like to have the subject line autofill with values (first and last name) entered into two different cells in the second worksheet.
I have been browsing the forums / google for a while now but am unable to find a solution that works.
Here is the what I'm currently using:
Set OutApp = CreateObject("Outlook.Application")
'On Error Resume Next
'OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = ""
.Body = "The form is attached."
.Attachments.Add wb2.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0
Currently it fills the subject line of the email with a static value that I've entered into the code. The problem is that I have dozens of these in my email and it's a mess trying to keep track.
I would like to have the subject line autofill with values (first and last name) entered into two different cells in the second worksheet.
I have been browsing the forums / google for a while now but am unable to find a solution that works.
Here is the what I'm currently using:
Set OutApp = CreateObject("Outlook.Application")
'On Error Resume Next
'OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = ""
.Body = "The form is attached."
.Attachments.Add wb2.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
On Error GoTo 0