This don't work in Outlook 2002?

G

George Hester

Sub TestReadHTML(ieDoc As String)
Dim ieApp As SHDocVw.InternetExplorer
Dim webDoc As Object
Dim ol As New Outlook.Application
Dim str As String
Dim itm As MailItem

Set ieApp = CreateObject("InternetExplorer.Application")
ieApp.Visible = True
ieApp.navigate ieDoc
Set webDoc = ieApp.document
Set itm = ol.CreateItem(0)
itm.HTMLBody = webDoc.documentElement.outerHTML
itm.InternetCodepage = 1253
Debug.Print itm.HTMLBody
itm.Display
End Sub
 
T

Tom Rizzo [MSFT]

The outlook object model is limited when running in a browser for security
reasons.

Tom

--
Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint? Check out http://www.microsoft.com/MSPress/books/5517.asp

This posting is provided "AS IS" with no warranties, and confers no rights.



Sub TestReadHTML(ieDoc As String)
Dim ieApp As SHDocVw.InternetExplorer
Dim webDoc As Object
Dim ol As New Outlook.Application
Dim str As String
Dim itm As MailItem

Set ieApp = CreateObject("InternetExplorer.Application")
ieApp.Visible = True
ieApp.navigate ieDoc
Set webDoc = ieApp.document
Set itm = ol.CreateItem(0)
itm.HTMLBody = webDoc.documentElement.outerHTML
itm.InternetCodepage = 1253
Debug.Print itm.HTMLBody
itm.Display
End Sub
 
G

George Hester

Actually I got it to work.

The probkem was here ieApp.navigate ieDoc

ieDoc must be in URL form. and changed navigate to location.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top