Scalabium Software

SMExport/SMImport suites
Knowledge for your independence'.
Home Delphi and C++Builder tips


#127: How can I print url/html file using IE browser?

today 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');


Published: September 27, 2001

See also
 
Viewer for TNEF-files (winmail.dat)
Database Information Manager
Paradox Password Recovery
Excel Reader (dll)
Paradox to MS Access converter
SMDBGrid
ExcelFile Viewer
ABA Spreadsheet Convert
DBISAM Password Recovery
Paradox to Text converter
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2021, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport advertising