Sample code for 30+ languages & platforms
PowerBuilder

Example to Download Web Page as MHT Archive

See more MHT / HTML Email Examples

Demonstrates how to download a web page into a .mht web archive.

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Mht

li_Success = 0

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

li_Success = loo_Mht.GetAndSaveMHT("http://www.piscatur.com/","qa_data/mht/piscatur.mht")
if li_Success = 0 then
    Write-Debug loo_Mht.LastErrorText
    destroy loo_Mht
    return
else
    Write-Debug "MHT Created!"
end if



destroy loo_Mht