代码如下:
procedure TForm1.Button2Click(Sender: TObject);
var a,b: OleVariant
c: longint;
begin
a:=0;
b:=0;
c := WebBrowser1.QueryStatusWB(OLECMDID_PRINT);
if c>0 then
WebBrowser1.ExecWB(OLECMDID_PRINT,
OLECMDEXECOPT_PROMPTUSER,
a, b)
else
showmessage('不能打印!');
end;