Article ID: 311280 - Last Review: July 15, 2004 - Revision: 3.1 How To Programmatically Change Printer Settings for Internet Explorer and WebBrowser Control by Using Visual Basic .NETThis article was previously published under Q311280 On This PageSUMMARY This article describes how to programmatically set the page
margins, the header, and the footer for printing from Internet Explorer and the
WebBrowser control. Description of the TechniqueUsers can easily change Internet Explorer printer settings for the page margins, the header, and the footer through the Internet Explorer user interface. However, Internet Explorer and the WebBrowser control do not include methods to change these settings programmatically.NOTE: You cannot use the ExecWB command to set the page margins, the header, or the footer. These values are stored in the registry. If you need to programmatically change the printer settings for Internet Explorer or the WebBrowser control, you can only change the page margins, the header information, and the footer information. You cannot programmatically change other settings such as the page orientation or the default printer. The following steps outline how Microsoft Internet Explorer accesses the printer settings:
Visual Basic .NET Code to Modify Registry KeyWARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.This sample Visual Basic .NET code illustrates how to modify the required registry key: | Article Translations
|
Back to the top
