email from workbook

stans
Lounger
Posts: 38
Joined: 26 Feb 2010, 14:01

email from workbook

Post by stans »

Where would I place the email address in the macro below.
It attaches the workbook but I want it to enter the email address to send it to.


Sub email()
'
' email Macro
' Macro recorded 2/26/2010 by stans'
' Keyboard Shortcut: Ctrl+e
'
Application.Dialogs(xlDialogSendMail).Show
End Sub

User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: email from workbook

Post by HansV »

Try this:

Application.Dialogs(xlDialogSendMail).Show Arg1:="someone@company.com"

You can also specify the subject:

Application.Dialogs(xlDialogSendMail).Show Arg1:="someone@company.com", Arg2:="Monthly Report"
Best wishes,
Hans

stans
Lounger
Posts: 38
Joined: 26 Feb 2010, 14:01

Re: email from workbook

Post by stans »

That'll do it--- glad you included the subject line---Thanks