<div class="codetitle"> <span><a style="CURSOR: pointer" data="40591" class="copybut" id="copybut40591" onclick="doCopy('code40591')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code40591"> <br><script language="JScript"> <br>var hkey_root ,hkey_path,hkey_key <br>hkey_root="HKEY_CURRENT_USER" <br>hkey_path="\Software\Microsoft\Internet Explorer\PageSetup\" <br>//Set the header and footer for web page printing to be empty<br>function pagesetup_null( ) <br>{ <br>try{ <br> var RegWsh = new ActiveXObject("WScript.Shell") <br> hkey_key="header" <br> RegWsh.RegWrite(hkey_root hkey_path hkey_key,"") <br> hkey_key="footer" <br> RegWsh.RegWrite(hkey_root hkey_path hkey_key,"") <br> }catch(e){alert(e.name " " e.message)} <br>} <br>//Settings The header and footer printed on the web page are the default values <br>function pagesetup_default() <br>{ <br> try{ <br> var RegWsh = new ActiveXObject("WScript.Shell") <br> hkey_key="header" <br> RegWsh.RegWrite(hkey_root hkey_path hkey_key,"&w&bpage number,&p/&P") <br> hkey_key="footer" <br> RegWsh.RegWrite(hkey_root hkey_path hkey_key,"&u&b&d") <br> }catch(e) {alert(e.name " " e.message)} <br>} <br></script> <br><body > <br><input type="button" value="Restore page number" onclick=pagesetup_default()> <br><input type="button" value="Clear page number" onclick=pagesetup_null()> <br></body> <br></html> <br> <br> </div>