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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generate and send mail

Status
Not open for further replies.

idono

Technical User
Jan 16, 2002
71
US
How can I send a mail message(through outlook) from Excel VBA.
 
Hi,
Here's one that I did. It sends the ActiveWorkbook -- just modify to suite...
Code:
   Dim sSendTo As String
   
   Application.ScreenUpdating = False
   
   sPath = ActiveWorkbook.Path
   sWorkbookName = sPath & "\" & "S" & Month(Now()) & Day(Now()) & Hour(Now()) & Minute(Now()) & Second(Now()) & ".xls"
   ActiveWorkbook.SaveAs FileName:=sWorkbookName
   
   sSendTo = Range("SendTo")
   Sheets("Parameters").Activate
   Range("SendTo").Copy
   
   With Application.Dialogs(xlDialogSendMail)
      .Show sSendTo, "Survey"
   End With
Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top