#1   Report Post  
greg7468
 
Posts: n/a
Default 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   Report Post  
Chad
 
Posts: n/a
Default

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
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
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 12:57 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"