excel vba outlook email
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA Outlook Email

Excel VBA Outlook Email

resolvedResolved · High Priority · Version 2007

replyReply Mon 27 Apr 2009, 12:17Delegate Diane said...

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

For upcoming training course dates see: Pricing & availability

replyReply Tue 28 Apr 2009, 16:33Trainer Jacob said...

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

replyReply Wed 29 Apr 2009, 17:58Delegate Diane said...

RE: Excel VBA Outlook Email

Hi Jacob

Thanks for your response. I've actually now come up with a solution.

Thanks though
Diane

 

Please browse our web site to find out more about
training in excel and other Microsoft training courses.

Excel tip:

Enter formulae into multiple cells

If a formula is to be used in a series of cells, select the cells first. Now type in your formula and hold the Ctrl key while you press Enter. This enters the formula in each selected cell.

Just be careful with your absolute and relative cell references.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard