Kyle Williamson
Kyle Williamson

Reputation: 2184

Control page setup options in Delphi without showing Page Setup dialog

In my Delphi application, I can use the following code to show the Page Setup dialog to my users before printing.

//WebHTML is a TWebBrowser with a Document loaded.
WebHTML.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);

Page Setup Dialog

Is it possible to change these page setup options using code (without showing the Page Setup dialog to my users)? I specifically want to control the Header and Footer options so that all users will have the same headers and footers.

Upvotes: 0

Views: 156

Answers (1)

Kyle Williamson
Kyle Williamson

Reputation: 2184

The page setup settings are saved and loaded using Windows Registry keys. I wrote code to change the keys at the location "Computer\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup".

Internet Explorer Page Setup registry keys

Upvotes: 0

Related Questions