M
Martin
Hello,
I am trying to send a Mail with a HTML body created from a range. Using the
following code:
Sub test()
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
rngesend = Selection
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.HTMLBody =
ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange,
Filename:="C:\tempsht.htm", Sheet:=rngesend.Parent.Name,
Source:=rngesend.Address, HtmlType:=xlHtmlStatic)
.Display
End With
End Sub
I get an error pop-up at the line where I define the HTML body. Can somebody
help on this?
Many Thanks
Martin
I am trying to send a Mail with a HTML body created from a range. Using the
following code:
Sub test()
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
rngesend = Selection
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.HTMLBody =
ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange,
Filename:="C:\tempsht.htm", Sheet:=rngesend.Parent.Name,
Source:=rngesend.Address, HtmlType:=xlHtmlStatic)
.Display
End With
End Sub
I get an error pop-up at the line where I define the HTML body. Can somebody
help on this?
Many Thanks
Martin