Sample code for 30+ languages & platforms
PowerBuilder

Save Web Page to MHT String

See more MHT / HTML Email Examples

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.

Chilkat PowerBuilder Downloads

PowerBuilder
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
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