//直接在WebBrowser中顯示字符串
procedure ShowInWebBrowser(WebB:TWebBrowser;Str:String);
var
v: Variant;
HTMLDocument: IHtmlDocument2;
begin
HTMLDocument := WebB.Document as IHtmlDocument2;
if (assigned(HtmlDocument)) then begin
v := VarArrayCreate([0, 0], varVariant);
v[0] := str; //that is to be shown
HtmlDocument.Write(PSafeArray(TVarData(v).VArray));
HtmlDocument.Close;
end;
end;