Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add shortcut instead of file to Email with Macro

I have the following code where a macro in an excel
spreadsheet saves the current file then attaches a copy
of it to a e-mail. I would like it to now add an
attachment to the file instead of a copy of the file, in
the body of the email.

Thank you in advance
Rich

Here is my code

Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Dim oOLapp As Object
Dim oMailItem As Object
Set oOLapp = CreateObject("Outlook.Application")
Set oMailItem = oOLapp.CreateItem(0)
With oMailItem

.Attachments.Add "\\Simba\CSHARE\Employee Forms\Sales
Log sheets\NHS\Co#4 NHS Daily sales log.xls"
.Subject = "Co#4 NHS Daily sales log for Review"
.Body = "Here are Yesterday's Sales"
.Recipients.Add "Joseph Calabrese"
.Recipients.Add "Larry Schreiber"
.Recipients.Add "Craig Schreiber"
.Recipients.Add "Joe Hurley"
.Recipients.Add "Rich Pieri"
.Display '(or .Send if you don't want to look at it
first
Set oOLapp = Nothing
Set oMailItem = Nothing
End With

Application.Visible = True
Application.EnableEvents = True
ThisWorkbook.Close
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Add shortcut instead of file to Email with Macro

See

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



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Richard Pieri" wrote in message ...
I have the following code where a macro in an excel
spreadsheet saves the current file then attaches a copy
of it to a e-mail. I would like it to now add an
attachment to the file instead of a copy of the file, in
the body of the email.

Thank you in advance
Rich

Here is my code

Private Sub CommandButton1_Click()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Dim oOLapp As Object
Dim oMailItem As Object
Set oOLapp = CreateObject("Outlook.Application")
Set oMailItem = oOLapp.CreateItem(0)
With oMailItem

.Attachments.Add "\\Simba\CSHARE\Employee Forms\Sales
Log sheets\NHS\Co#4 NHS Daily sales log.xls"
.Subject = "Co#4 NHS Daily sales log for Review"
.Body = "Here are Yesterday's Sales"
.Recipients.Add "Joseph Calabrese"
.Recipients.Add "Larry Schreiber"
.Recipients.Add "Craig Schreiber"
.Recipients.Add "Joe Hurley"
.Recipients.Add "Rich Pieri"
.Display '(or .Send if you don't want to look at it
first
Set oOLapp = Nothing
Set oMailItem = Nothing
End With

Application.Visible = True
Application.EnableEvents = True
ThisWorkbook.Close
End Sub



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
How do I use macro in Excel 2007 to convert to and email PDF file rick5555 Excel Worksheet Functions 9 November 15th 13 04:39 PM
Insert Picture from File - Shortcut/Macro? twinkle17 Excel Discussion (Misc queries) 2 November 26th 09 08:47 PM
What is the shortcut to email an excel document? thanks Claudia[_2_] Excel Discussion (Misc queries) 1 March 6th 09 04:12 PM
Macro to split excel file into seperate files and then email LITTLE PETE Excel Discussion (Misc queries) 1 October 6th 08 01:37 PM
HELP for a macro to create a shortcut of an excel file on the desk Francesco Excel Discussion (Misc queries) 2 April 13th 06 05:13 PM


All times are GMT +1. The time now is 10:59 AM.

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"