Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Email question

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 ", "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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Email question

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


--
Regards,
Tom Ogilvy


"olly" wrote in message
...
Ok thanks-but can you put for instance
.SendMail Array(" ", "),

what i want it to do is auto put someone in the sending
list, but not to send the mail until the user selects
another person from the address book. Is this how you do
it ? doesn't seem to be working when i try it..
any help very much appreciated
cheers
olly


-----Original Message-----
Sendmail doesn't make that distinction (or offer that

option). You can send
to multiple people with

..SendMail Array

"),
"Confirmation - "

Regards,
Tom Ogilvy





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Email Question John Excel Discussion (Misc queries) 4 December 5th 08 10:44 PM
cannot open email reply to previous question CatLoverx6 Excel Discussion (Misc queries) 1 August 4th 08 11:14 PM
Email from Excel - 2 Part Question Jenny B. Excel Discussion (Misc queries) 0 January 13th 08 05:36 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM


All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"