whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1548)

Database (90)
Files (137)
Forms (107)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (131)
IntraWeb (0)
Math (76)
Misc (127)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (243)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

10 Visitors Online


 
...print a page in a TWebbrowser?
Autor: Thomas Stutz
[ Print tip ]  

Tip Rating (67):  
     


// First navigate to a page
// Zuerst zu einer Webseite navigieren

procedure TForm1.Button1Click(Sender: TObject);
begin
  
WebBrowser1.Navigate('http://www.SwissDelphiCenter.com');
end;

// Print without Printer Dialog
// Drucken ohne Druckerauswahldialog

procedure TForm1.Button2Click(Sender: TObject);
var
  
vaIn, vaOut: OleVariant;
begin
  
WebBrowser1.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,
    vaIn, vaOut);
end;

// Print with Printer Dialog
// Drucken mit Druckerauswahldialog

procedure TForm1.Button3Click(Sender: TObject);
var
  
vaIn, vaOut: OleVariant;
begin
  
WebBrowser1.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER,
    vaIn, vaOut);
end;

// Print Preview
// Druckvorschau

procedure TForm1.Button4Click(Sender: TObject);
var
  
vaIn, vaOut: OleVariant;
begin
  
WebBrowser1.ControlInterface.ExecWB(OLECMDID_PRINTPREVIEW,
    OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut);
end;

// Page Setup Dialog
// Seite einrichten Dialog

procedure TForm1.Button5Click(Sender: TObject);
var
  
vaIn, vaOut: OleVariant;
begin
  
WebBrowser1.ControlInterface.ExecWB(OLECMDID_PAGESETUP, OLECMDEXECOPT_PROMPTUSER,
    vaIn, vaOut);
end;

// as of Internet Explorer 4
// ab Internet Explorer 4

 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners