Add recipients to Outlook through VBA code

finaljustice

Board Regular
Joined
Oct 6, 2010
Messages
175
Hi,
I've created a code to make a routine and then send an email of the worksheet. The part that is new to me is the sending e-mail using VBA, so I decided to record the action and then adapt to what I need. From what i recorded I basically got this:

Code:
Sub e-mail ()
                                                     
Sheets(1).Copy


Application.Dialogs(xlDialogSendMail).Show
    
End Sub

"Application.Dialogs(xlDialogSendMail).Show" opens an e-mail message to be sent, requiring manual input of the recipients, I would like to automate even this part so that I can just message a "E-mail was sent" notification.

Could anyone help me in how do I code the adding TO: list and make it send?

Thanks for your attention

final
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi,
I've created a code to make a routine and then send an email of the worksheet. The part that is new to me is the sending e-mail using VBA, so I decided to record the action and then adapt to what I need. From what i recorded I basically got this:

Code:
Sub e-mail ()
                                                     
Sheets(1).Copy


Application.Dialogs(xlDialogSendMail).Show
    
End Sub

"Application.Dialogs(xlDialogSendMail).Show" opens an e-mail message to be sent, requiring manual input of the recipients, I would like to automate even this part so that I can just message a "E-mail was sent" notification.

Could anyone help me in how do I code the adding TO: list and make it send?

Thanks for your attention

final

this site should get you started

http://www.rondebruin.nl/sendmail.htm
 
Upvote 0

Forum statistics

Threads
1,207,089
Messages
6,076,517
Members
446,211
Latest member
b306750

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top