var
Document1: IHtmlDocument2;
vleVariant;
begin
webbrowser1.Navigate('about:blank');
Document1 := webbrowser1.Document as IHtmlDocument2;
if (Assigned(Document1)) then begin
v := VarArrayCreate([0, 0], varVariant);
v[0] := '<html><body>你的HTML文本代码</body></html>';
Document1.Write(PSafeArray(TVarData(v).VArray));
Document1.Close;
end;
end;