1
uses mshtml, ActiveX,ComObj;
2
3 procedure TForm1.Button1Click(Sender: TObject);
4 var
5 v: Variant;
6 HTMLDocument: IHTMLDocument2;
7 begin
8 WebBrowser1.Navigate('about:blank');
9 HTMLDocument := WebBrowser1.Document as IHTMLDocument2;
10 v := VarArrayCreate([0, 0], varVariant);
11 v[0] := ' < HTML >< h1 > Test </ h1 >< br /> aaaaaa </ html > '; // Here's your HTML string
12 HTMLDocument.Write(PSafeArray(TVarData(v).VArray));
13 HTMLDocument.Close;
14 end
2
3 procedure TForm1.Button1Click(Sender: TObject);
4 var
5 v: Variant;
6 HTMLDocument: IHTMLDocument2;
7 begin
8 WebBrowser1.Navigate('about:blank');
9 HTMLDocument := WebBrowser1.Document as IHTMLDocument2;
10 v := VarArrayCreate([0, 0], varVariant);
11 v[0] := ' < HTML >< h1 > Test </ h1 >< br /> aaaaaa </ html > '; // Here's your HTML string
12 HTMLDocument.Write(PSafeArray(TVarData(v).VArray));
13 HTMLDocument.Close;
14 end
本文转自 OldHawk 博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2007/04/29/731870.html
,如需转载请自行联系原作者