在Delphi中控制页面设置选项,而不显示页面设置对话框。

huangapple go评论70阅读模式
英文:

Control page setup options in Delphi without showing Page Setup dialog

问题

在我的Delphi应用程序中,我可以使用以下代码在打印之前向用户显示页面设置对话框。

//WebHTML是一个加载了文档的TWebBrowser。
WebHTML.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);

是否可以使用代码更改这些页面设置选项(而不向用户显示页面设置对话框)?我特别想要控制页眉和页脚选项,以便所有用户都具有相同的页眉和页脚。

英文:

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

在Delphi中控制页面设置选项,而不显示页面设置对话框。

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.

答案1

得分: 0

以下是已翻译的内容:

页面设置设置被保存和加载,使用Windows注册表键。我编写了代码来更改位于“计算机\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup”位置的键。

英文:

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".

在Delphi中控制页面设置选项,而不显示页面设置对话框。

huangapple
  • 本文由 发表于 2023年5月17日 22:30:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76273234.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定