Email question

O

olly

I have the following code to send a mail from excel

Private Sub Email_Click()
Dim strDate As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-
mm-ss")
FName$ = "Confirmation - " & strDate
Application.SheetsInNewWorkbook = 1
Set wbNew = Workbooks.Add
With wbNew
ThisWorkbook.ActiveSheet.Copy (.Worksheets(1))
..Worksheets(2).Delete
With .ActiveSheet.UsedRange
..Copy
..PasteSpecial xlPasteValues
Worksheets(1).Protect password:="*******", _
DrawingObjects:=False, Contents:=True, Scenarios:=True
End With
..SaveAs Filename:="c:\" & FName$ & ".xls"
..SendMail "(e-mail address removed)", "Confirmation - " &
strDate
..ChangeFileAccess xlReadOnly
Kill .FullName
..Close SaveChanges:=False
End With
ThisWorkbook.Close SaveChanges:=False
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub

But how would i get this code to send a CC to a recipient?
Any help greatly appreciated
cheers
olly
 
T

Tom Ogilvy

No. Sendmail is a single command - it doesn't offer choices or interaction.

If you want to interact with the user, you will need to program that
interface. Put up the choices in a dialog, then put the selection in the
array and do sendmail. Or you can get more sophisticated by programming
the Outlook object model if you wish. See Ron de Bruin's site for some
discussion.

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

Dick Kusileka also has some information:
www.dicks-clicks.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top