ricardo1023
Programmer
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
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