![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Feb 2003
Posts: 214
|
I'm using the following code to email a file upon close. How do I modify it so I can send it to two or three recipients?
Code:
ActiveWorkbook.SendMail Recipients:="myname@mybusiness.com", _
Subject:="Excel File"
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Sep 2002
Location: Suffolk, UK
Posts: 8,012
|
Hey - well as i recall (I don't use the sendmail method) you would set the addresses up as an array, and I am not sure if XL likes you using an array unless the addresses are fixed (ie not variable - and thus never change) - but the sendmail method is pretty limited as it won't allow for a message body, just a subject.
If you want you can actually do a lot more by simply using Outlook as an object in Xl - which gives you all the options you would have if you were sending an email from Outlook. let me know.
__________________
Does my a$$ look big in this picture ? |
|
|
|
|
|
#3 |
|
Join Date: Dec 2002
Location: Larache--Morocco
Posts: 3,440
|
Hi,
As an extension to Laws10, you can use an array as follows: Code:
Private Sub CommandButton1_Click()
CommandButton1.TakeFocus******* = True
ar = Array("myname@mybusiness.com", "jaafar_larache@yahoo.co.uk", "xxx@yyy.com")
ThisWorkbook.SendMail Recipients:=ar, Subject:="Excel File"
End Sub
Code:
Private Sub CommandButton1_Click()
CommandButton1.TakeFocus******* = True
Application.Dialogs(xlDialogSendMail).Show
End Sub
Hope this helps.
__________________
Regards. Jaafar. Excel 2003 Win XP Happiness is when what you think, what you say, and what you do are in harmony. http://www.laracheenelmundo.com/ |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|