Need Help Referencing IE Object Model

J

John Lane

I have tried variations of the code scrap below to get at the html text in IE
from VB. Now it says the there is no method avaiaible. Does anyone know how
to attach to the IE object model and get at the html code? Thanks.

Dim IE As Application
Dim Doc As Object

Set IE = CreateObject("InternetExplorer.Application")

Set Doc = IE.Document

MsgBox "Entire HTML: " & vbCrLf & vbCrLf & Doc

With IE.body

MsgBox "<Body> outer HTML: " & vbCrLf & vbCrLf & .outerHTML
MsgBox "<Body> inner HTML: " & vbCrLf & vbCrLf & .innerHTML

End With
 
Top