(PowerBuilder) Pack Local HTML File and Referenced Images as MHT Archive
Demonstrates how to pack a local HTML file and referenced files (images, style sheets, etc.) into a .mht web archive.
integer li_rc
oleobject loo_Mht
integer li_Success
// 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
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
|