|
| to print url/html file using IE browser |  
|
|---|
Product: Delphi all versions | Category: Internet / Web | Skill Level:
 | Scoring:  | Last Update: 10/22/2001 | Search Keys: delphi delphi3000 article borland vcl code-snippet IE browser print html OLE | Times Scored: 7 | Visits: 12057 | Uploader: Mike Shkolnik Company: Scalabium Software | Reference: http://www.scalabium.com/faq/dct0127.htm | | | Question/Problem/Abstract:
How can I print url/html file using IE browser? | Answer:
I want to show how you can activate printing of any url and/or html file using installed IE.
I solved this task yesterday and solution is very useful and have a small
size:-)
uses ComObj;
procedure PrintHTMLByIE(const url: string);
const
OLECMDID_PRINT = $00000006;
OLECMDEXECOPT_DONTPROMPTUSER = $00000002;
var
ie, vaIn, vaOut: Variant;
begin
ie := CreateOleObject('InternetExplorer.Application');
ie.Navigate(url);
ie.Visible := True;
ie.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut);
end;
Sample:
PrintHTMLByIE('file:\\c:\misha\webpage\index.htm');
or
PrintHTMLByIE('http:\\www.scalabium.com\sme\index.htm');
|
|