Question about Nimrod email code

babycody

Well-known Member
Joined
Jul 8, 2003
Messages
1,395
Nimrod provided the following code in another post:
Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 
ActiveWorkbook.SendMail Recipients:="EmailAddressHere" 
End Sub
I was curious if it were possible to add a few more features to the code?
1. Currently it creates an email message before saving. Can code be added to have it create an email apon closing also?
2. Can Cc and Bcc be added to this?
3. Can a subject line be added?
4. I am most curious as to the possibility of bypassing the popup that ask send or don't send. Can code be added so that the email is sent without any confirmation?
5. How would I go about putting multiple email addresses into the main, Cc, and Bcc?
Thanks for any time you give toward this. I have viewed several post on the subject of emailing. I have followed a lot of links, but haven't found one that incompassed all aspects listed above. I tried to incorporate bits of code into one with no success. Just a VBA novice.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
The above macro uses the SendMail syntax. With SendMail, it is not possible to:
1) Send text in the Body of the mail
2) Use the CC or BCC field
3) Attach other files

(source: http://www.rondebruin.nl/mail/folder1/mail1.htm)

However, there are alternatives. As a starter, see the various email macros authored by Ron de Bruin (Microsoft MVP): http://www.rondebruin.nl/sendmail.htm

Another good source of email macros is **** Kusleika’s web site: http://www.dicks-clicks.com/excel/olSending.htm

See if there is any macro from the above sites that come close to what you need. If so, it may be possible to amend the macro to do exactly what you want.


HTH

Mike
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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