Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting MHT Files to HTML

Status
Not open for further replies.

ricardo1023

Programmer
Mar 23, 2008
54
US
I do have the following code to convert MHT files into HTML. The problem is that just work on Internet Explorer 6.0 and is slow. Could you suggest how to make the code to work in any Internet explorer code and at the same time make it more efficient?

Thank you



Sub save_html_sub(savefile As String, surl As String)


' savefile = "\\Ldsi01-nystor01\LDSI\HECTOR\TEST\TEST00000004\TEST00000004.html"
' surl = "\\Ldsi01-nystor01\LDSI\HECTOR\TEST\TEST00000004\TEST00000004.mht" 'any valid surl

Set oie = CreateObject("internetexplorer.application")
oie.Visible = False
oie.navigate surl
'Do While oie.readystate <> 4
' wscript.sleep 50
'Loop

'Do While Not oie.readystate <> 4
' wscript.sleep
'Loop

s = oie.Document.documentElement.outerHTML

Set fso = CreateObject("scripting.filesystemobject")
Set ofile = fso.createtextfile(savefile, True)
ofile.Write s
ofile.Close
Set ofile = Nothing

oie.Visible = True
'wscript.Echo "to quit"
oie.Quit
Set oie = Nothing







End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top