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

I'm trying to get code that will email the active workbook
to an email address that is located in a cell A1. I found
the code below, but I get the following message whenever I
try to use it: "Compile Error: User-defined type not
defined". Any suggestions? Thanks! Matt

Sub Send_Msg()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = Range ("A1")
.Subject = "Test"
.Body = "Test"
.Display
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub
 
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
protect a workbook to email Shazza Excel Discussion (Misc queries) 2 September 12th 07 05:53 AM
How to email 1 sheet in a workbook? Hosh New Users to Excel 2 April 5th 07 01:42 PM
Email a worksheet vs workbook Cheri Excel Discussion (Misc queries) 2 February 15th 06 05:20 PM
cant email workbook thru excel jaredwetmore Excel Discussion (Misc queries) 2 September 16th 05 06:37 PM
how to email one sheet only of a workbook Raven Excel Discussion (Misc queries) 2 May 14th 05 03:39 PM


All times are GMT +1. The time now is 11:20 AM.

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

About Us

"It's about Microsoft Excel"