Sample code for 30+ languages & platforms
Delphi DLL

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 Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Mht;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
mht: HCkMht;

begin
success := False;

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

mht := CkMht_Create();

success := CkMht_GetAndSaveMHT(mht,'http://www.piscatur.com/','qa_data/mht/piscatur.mht');
if (success = False) then
  begin
    Memo1.Lines.Add(CkMht__lastErrorText(mht));
    Exit;
  end
else
  begin
    Memo1.Lines.Add('MHT Created!');
  end;

CkMht_Dispose(mht);

end;