procedure TForm1.Button1Click(Sender: TObject);
var
vv: Variant;
HTMLDocument: IHTMLDocument2;
begin
tag := 0;
WebBrowser1.Navigate('about:blank');
while(tag=0) do Application.ProcessMessages;
vv := VarArrayCreate([0, 0], varVariant);
vv[0] := '<html><body><p>hello world!</p></body></html>';
HTMLDocument := WebBrowser1.Document as IHTMLDocument2;
HTMLDocument.Write(PSafeArray(TVarData(vv).VArray));
HTMLDocument.Close;
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
tag := 1;
end;