Hi,
I just started learning VBA a couple weeks ago and still very new to this. I have a project, and I need to make something that send email notifications to newly assigned project owners.
Background: Column O contains a drop list of the names of the recipients (which will be project owners). These cells are empty and are only selected by the project allocator when the project details are entered in column A to M. There are only 5 options, so I thought I could automate the recipient emails. The main things I'm looking for is, once the recipient name is selected column O, how to:
I would greatly appreciate if someone can help me with this code, or point me in a direction where I can research on how to make this happen.
Many thanks.
I just started learning VBA a couple weeks ago and still very new to this. I have a project, and I need to make something that send email notifications to newly assigned project owners.
Background: Column O contains a drop list of the names of the recipients (which will be project owners). These cells are empty and are only selected by the project allocator when the project details are entered in column A to M. There are only 5 options, so I thought I could automate the recipient emails. The main things I'm looking for is, once the recipient name is selected column O, how to:
- make a Outlook window pop up with recipient's email (e.g Person1, Person2, Person3...).>>This is the main thing I need for the project.
- In the body message, include details of the project in column B along with some other written text (N.B "This is a notification regarding a new assigned project: (Text in column B). Please log into the tracker and update your project status.">> I can do without this but would be nice to have.
- how to make sure it will only trigger the email when the NEW value is assigned in column O
- how to make the recipient email pop up based on the new value in column O
- how to write the body text based on the value in column B
VBA Code:
Sub Notification()
If ....
'Send notification
Dim OlApp As Object
Dim NewMail As Object
Dim xMailBody As String
Set OlApp = CreateObject("Outlook.Application")
Set NewMail = OlApp.CreateItem(0)
xMailBody = "This is a notification regarding a new assigned project. Please log in to the tracker and update your project status"
On Error Resume Next
With NewMail
.To = "email@email.com"
.Subject = "New project notification"
.Display
End With
On Error GoTo 0
Set NewMail = Nothing
Set OlApp = Nothing
End Sub
I would greatly appreciate if someone can help me with this code, or point me in a direction where I can research on how to make this happen.
Many thanks.