procedure WB_SaveAs_MHT(WB: TWebBrowser; FileName: TFileName);
var
Msg: IMessage;
Conf: IConfiguration;
Stream: _Stream;
URL: Widestring;
begin
if not Assigned(WB.Document) then
Exit;
URL := WB.LocationURL;
Msg := CoMessage.Create;
Conf := CoConfiguration.Create;
try
Msg.Configuration := Conf;
Msg.CreateMHTMLBody(URL, cdoSuppressNone, '', '');
Stream := Msg.GetStream;
Stream.SaveToFile(FileName, adSaveCreateOverWrite);
finally
Msg := nil;
Conf := nil;
Stream := nil;
end;
end; (* WB_SaveAs_MHT *)