You cannot use the ExecWB command to set page margins and the header or footer. These values are stored in the registry.
There might be a need to change the print settings of Internet Explorer or the WebBrowser control programmatically. The only settings that can be changed are page margins, and header and footer information. There is no supported way to change other settings like page orientation or printer.
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
This is how Microsoft Internet Explorer accesses the printing settings:
For Page Margins, Microsoft Internet Explorer first tries to get the values from this registry key:
For the Header and Footer, the values are picked up from the following:
The defaults are 0.75 for margins,
For the Internet Explorer default printer, default values are provided from:
Please note that these values are system-wide and affect all instances of the WebBrowser control and Internet Explorer for the current user.
Article ID: 236777 - Last Review: Jun 15, 2012 - Revision: 1