Home |
Search |
Today's Posts |
#1
|
|||
|
|||
E-mail macro
Hi all, I have a workbook that I send out daily to a contact list within outlook. What is the best way of doing this with a macro to work off a button on the worksheet. Thanks in advance. -- greg7468 ------------------------------------------------------------------------ greg7468's Profile: http://www.excelforum.com/member.php...fo&userid=9031 View this thread: http://www.excelforum.com/showthread...hreadid=469881 |
#2
|
|||
|
|||
Here's how to send a workbook from Excel as an attachment:
Create a macro with the code below and then create a button that calls that macro. Keep in mind you must add a reference to the Microsoft outlook Library (Tools\References). 'You must add a reference to the Microsoft outlook Library Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) Dim strbody As String strbody = "here is the workbook" With OutMail .To = " 'or whatever your recipients name '.CC = "" 'if any '.BCC = 'if any .Subject = "here" .Body = strbody 'define attachment attachmentname = "C:\Documents and Settings\All Users\Desktop\Book1.xls" 'your path Set myAttachments = OutMail.Attachments myAttachments.Add attachmentname .Display 'or use .Send to bypass the display End With Hope this helps! -Chad "greg7468" wrote: Hi all, I have a workbook that I send out daily to a contact list within outlook. What is the best way of doing this with a macro to work off a button on the worksheet. Thanks in advance. -- greg7468 ------------------------------------------------------------------------ greg7468's Profile: http://www.excelforum.com/member.php...fo&userid=9031 View this thread: http://www.excelforum.com/showthread...hreadid=469881 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Help with macro looping and color query function | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |