Sample code for 30+ languages & platforms
PowerBuilder

Pack Local HTML File and Referenced Images as MHT Archive

See more MHT / HTML Email Examples

Demonstrates how to pack a local HTML file and referenced files (images, style sheets, etc.) 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("C:/AAWorkarea/mht_unpack/test.html","qa_output/test.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