Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send mail to cc: recipient

Status
Not open for further replies.

pnb627

Technical User
Mar 11, 2003
2
US
I have an excel spreadsheet with the following command:

Application.Dialogs(xlDialogSendMail).Show "test@test.com, "CVS End of Shift " & ActiveSheet.Name

Finish:
End Sub

This works great but I have attempted to add another email recipient using a semi-colon between the two, but when that macro runs, it displays the proper email recipients, but the address cannot be found by the exchange server. I have tried adding a space after the semi-colon also with the same results.

How can I add another recipient or a cc: recipient.

Thanks.
 
First, this is NOT VBScript, it's VBA. When you have a VBA question, post in the VBA forum. forum707

To answer your question, add a space before and after the semicolon. Otherwise, the semicolon may be interpreted as part of the address, instead of a delimiter.

Code:
sRecip = "you@home.com ; you@work.com ; you@bahamas.com"

Application.Dialogs(xlDialogSendMail).Show sRecip, "CVS End of Shift " & ActiveSheet.Name

or use an array

sRecip = Array("you@home.com","you@work.com","you@bahamas.com")
Application.Dialogs(xlDialogSendMail).Show sRecip, "CVS End of Shift " & ActiveSheet.Name

AFAIK, you can only specify TO recipients using the Sendmail method or dialog. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top