Hi,
I am using this VBA to send a worksheet and I would like to be able to offer an option to add a variable to the subject line so we can distinguish emails...
So Ideally the user is offered a message box to enter a word or phrase, probably a location, and the subject line appends that word or phrase to it so that the email subject line would read...
"Training-Project (London)" but someone in York would send a mail "Training-Project (York)".
I am using this VBA to send a worksheet and I would like to be able to offer an option to add a variable to the subject line so we can distinguish emails...
VBA Code:
Sub SendWorkBook()
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.Display
.To = "email@email.com"
.CC = ""
.BCC = ""
.Subject = "Training-Project"
.Body = "See attached. Respond ASAP. Thank you."
.Attachments.Add Application.ActiveWorkbook.FullName
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
So Ideally the user is offered a message box to enter a word or phrase, probably a location, and the subject line appends that word or phrase to it so that the email subject line would read...
"Training-Project (London)" but someone in York would send a mail "Training-Project (York)".