View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sungen99[_42_] sungen99[_42_] is offline
external usenet poster
 
Posts: 1
Default Macro works in one workbook but not in another


This program will take a sheet and send it as an embedded email. It
works perfectly in a workbook with worksheets (sheet1)(sheet2)(sheet3)

For some reason when I enter this code into a workbook I actually need
to use it for whos worksheet name is (Recap) it sends the email just
fine BUT the contents of the mail are blank. In other words it does
not show the worksheet.

Any ideas?


Sub Mail_ActiveSheet_Body()
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
..To = "
..CC = ""
..BCC = ""
..Subject = "This is the Subject line"
..HTMLBody = RangetoHTML2
..Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


--
sungen99
------------------------------------------------------------------------
sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144
View this thread: http://www.excelforum.com/showthread...hreadid=505316