(PowerBuilder) Save Web Page to MHT String
Downloads a web page into a string variable containing MHT. MHT is a web archive with all images and style sheets embedded. It's a MIME-formatted text document. When saved with the .mht extension, Internet Explorer can open and display the page.
integer li_rc
oleobject loo_Mht
string ls_MhtStr
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Mht = create oleobject
// Use "Chilkat_9_5_0.Mht" for versions of Chilkat < 10.0.0
li_rc = loo_Mht.ConnectToNewObject("Chilkat.Mht")
if li_rc < 0 then
destroy loo_Mht
MessageBox("Error","Connecting to COM object failed")
return
end if
ls_MhtStr = loo_Mht.GetMHT("http://www.google.com/")
if loo_Mht.LastMethodSuccess <> 1 then
Write-Debug loo_Mht.LastErrorText
else
Write-Debug ls_MhtStr
end if
destroy loo_Mht
|