Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AR AR is offline
external usenet poster
 
Posts: 13
Default Mail Sheet as message body

Hi
I have used the following code for sending a mail from excel, this code
attach the active work book in the mail.
Im trying to send the worksheet as as message body of the mail

I've tried ".BodyHTML = SheetToHTMl(Activesheet) "

' Sub mail_with_outlook()

Dim Outapp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strto As String

Set Outapp = CreateObject("Outlook.application")
Set OutMail = Outapp.CreateItem(olMailItem)
strto = "
strsub = Sheets("Sheet1").Range("B11").Value
ActiveWorkbook.Save
With OutMail
.To = strto
.CC = strcc
.Subject = strsub
.Attachments.Add ActiveWorkbook.FullName

On Error Resume Next
..Send
End With

End Sub

but could not get the result, an any one help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Mail Sheet as message body

Hi Ar

Look here for a example
http://www.rondebruin.nl/mail/folder3/mail2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"AR" wrote in message ...
Hi
I have used the following code for sending a mail from excel, this code
attach the active work book in the mail.
Im trying to send the worksheet as as message body of the mail

I've tried ".BodyHTML = SheetToHTMl(Activesheet) "

' Sub mail_with_outlook()

Dim Outapp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strto As String

Set Outapp = CreateObject("Outlook.application")
Set OutMail = Outapp.CreateItem(olMailItem)
strto = "
strsub = Sheets("Sheet1").Range("B11").Value
ActiveWorkbook.Save
With OutMail
.To = strto
.CC = strcc
.Subject = strsub
.Attachments.Add ActiveWorkbook.FullName

On Error Resume Next
..Send
End With

End Sub

but could not get the result, an any one help



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
Excel(with hyperlinks) as a message body of outlook mail hans Excel Discussion (Misc queries) 1 July 7th 06 12:35 PM
Mail as body Balu Excel Discussion (Misc queries) 1 May 30th 06 04:17 PM
EXCEL FORMAT PROBLEM WHEN SENDING EXCEL SHEET AS MESSAGE BODY IN . P.S.Sodha Excel Discussion (Misc queries) 0 April 2nd 05 01:53 PM
Mail Worksheet as (html) message body Thomas Bartkus[_3_] Excel Programming 1 January 12th 04 03:12 AM
E-mail as message body not attachment Larry Empey Excel Programming 1 September 2nd 03 04:00 AM


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