View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default send sheet to email as html attachment

copy the sheet to a new workbook. SaveAs HTML and close the workbook. Use
code at Ron's site to attach it to the email and send. Delete the file

You can get most of the code you need by turning on the macro recorder and
performing the actions manually.

--
Regards,
Tom Ogilvy



"Pieter" wrote in message
...
Hello Readers,

I use the following working code (thanks to ron de bruin) :

Sub Mail_Loadingorder()
Dim OutApp As Object
Dim OutMail As Object
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = ThisWorkbook.Sheets("Loadingorder").Range("a1").Va lue
.CC = ""
.BCC = ""
.Subject = "Loadingorder " &

Sheets("Loadingorder").Range("h2").Value
.HTMLBody = SheetToHTML(ActiveSheet)
.Send 'or use .Display
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


Now i want to change this to attach the sheet as an html attachment

instead
of the
the sheet is standing in the body.

Anyone know this solution..

Greetings