用IE4.0提供的TWebBrowser控件, 其中ExeWB方法可以用来打开,保存,打印...
procedure TWebBrowser.ExecWB(cmdID: OLECMDID;
cmdexecopt: OLECMDEXECOPT;
var pvaIn: OleVariant;
var pvaOut: OleVariant);
begin
ControlInterface.ExecWB(cmdID, cmdexecopt, pvaIn, pvaOut);
end;
应用:
uses SHDocVw_TLB;
procedute PrintHTML;
var eQuery: LongInt;
begin
eQuery := WebBrowser1.QueryStatusWB(OLECMDID_PRINT);
if wQuery and OEMCMDF_Enabled then
WebBrowser1.ExecWB(OLECMDID_PRINT,
OLECMDEXECOPT_PROMPTUSER,
'','')
else
showmessage('Print is Disabled!');
end;
IE4.0 的OCX在 /Windows/System/ShDocVw.dll文件中