Diane has attended:
Excel VBA Intro Intermediate course
Excel VBA Outlook Email
Hi
I have the below code to be able to email myself a confirmation of a file creation. However at the moment I have to hard code the email address.
I want whoever is the user to get that email. Is there a way you can look up the user email address based on the Outlook account set up on the computer?
Dim oApp As Object
Dim oMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "diane.griffiths@ondemand.co.uk"
.Subject = "Your Project Submission has been accepted"
.Body = "text"
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
RE: Excel VBA Outlook Email
hi Diane
Thanks for this, I am going to have to sit down with one of my colleagues to get a reasonable idea if and how we can assist, will be back to you tomorrow.
Regards
Jacob