I'd like to load a string as an html file using MSHTML in VBScript and parse it. I can do this with "InternetExplorer.application" but I'd like to do it with "htmlfile" (MSHTML.HTMLDocument)
The following code:
Set h =  CreateObject("htmlfile")
h.body.innerHTML = "html goes here"
gives this error:
Microsoft VBScript runtime error: Object required: 'body'
How do I load the html string?
Probably cheating, but seems to work:
  Dim oHF : Set oHF = CreateObject("HTMLFILE")
  oHF.write "<html><body></body></html>"
  oHF.body.innerHTML = "<p>WhatEver</p>"
  WScript.Echo oHF.body.innerTEXT
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With