Hi
if i change line objMsg.Body = strBody
to objMsg.CreateHTMLBody "file//e:/temp/mit/upload/16122016_0834.htm"
i get this error
>>microsoft VBScript runtime error: 438
object doesn't support this property or method objMsg. CreateHTMLBody
VB Script
VBStart
Function CreateEmail(strTo, strSubj, strBody, html, strbodyhtml)
'Create OL App object
Set objOLApp = CreateObject("Outlook.Application")
If objOLApp is nothing then
MsgBox "Could not create OL App. Shutting Down"
Exit Function
End If
'Create a new mail item
Set objMsg = objOLApp.CreateItem(0)
If objMsg is nothing then
MsgBox "Could not create Mail Item. Shutting Down"
Exit Function
End If
'Set basic message parameters
objMsg.To = strTo
objMsg.Subject = strSubj
'objMsg.Body = strBody
objMsg.CreateHTMLBody "file//e:/temp/mit/upload/16122016_0834.htm"
''Send the message
objMsg.Send
''Free up the space
Set objOLApp = Nothing
Set objMsg = Nothing
CreateEmail = "Success"
End Function
VBEnd
objMsg.CreateHTMLBody
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7391
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: objMsg.CreateHTMLBody
I don't think that method is supported for Outlook items - at least not any more. It's a part of the IMessage interface, part of CDO. I know there are old articles on this forum that show what you've done but it looks like this may have changed in Outlook.
From what I have found it used to work in old versions of Outlook but no longer does (seemingly for "security" reasons!).
From what I have found it used to work in old versions of Outlook but no longer does (seemingly for "security" reasons!).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?