<HTML><HEAD>
<script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
'//设置网页打印的页眉页脚为空
function pagesetup_null()
    on error resume next
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\header"    
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
    hkey_key="\footer"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
end function
'//设置网页打印的页眉页脚为默认值
function pagesetup_default()
    on error resume next
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\header"    
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P"
    hkey_key="\footer"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d"
end function
</script>
</HEAD><BODY><br><br><br><br><br><br><p align=center>
<input type="button" value="清空页码" onclick=pagesetup_null()>
<input type="button" value="恢复页码" onclick=pagesetup_default()><br>
</p></BODY></HTML>

解决方案 »

  1.   

    <object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=5,60,0,360"></object><title>呵呵</title>
     <input  type="button" value="页面设置"
     onclick="factory.printing.PageSetup()">
     <input type="button" value="打印预览"
     onclick="factory.printing.Preview()">
     
    <script>
    function window.onload() {
      factory.printing.header = "居左显示&b居中显示&b居右显示页码,第&p页/共&P页"
      factory.printing.footer = "(自定义页脚)"
      factory.printing.leftMargin = 0.75
      factory.printing.topMargin = 1.5
      factory.printing.rightMargin = 0.75
      factory.printing.bottomMargin = 1.5
      }
    </script>