目前的JAVASCRIPT还不能做到,需要用自己或别人开发的控件.
如:
<head>
<title>打印确认</title>
<style media="print">
.noprint { display: none }
</style>
</head>
<body>
<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>
<script defer>
function window.onload() {
  //factory.printing.paperSize = "A3"
  factory.printing.header = ""
  factory.printing.footer = ""
  factory.printing.portrait = false
  idPrint1.disabled = false; // enable UI button
  idPrint2.disabled = false;
  idPrint3.disabled = false;
  idPrint4.disabled = false;
  factory.printing.leftMargin = 0
  factory.printing.topMargin = 5
  factory.printing.rightMargin = 5
  factory.printing.bottomMargin = 5
  }
</script>
<span style="text-decoration:underline">下划线</span>
<U>dsfaldj但是拉夫;飞机士大夫按时地方螺丝钉机发射点</U>
<div class=noprint>
  <input id="idPrint1" type="button" value="打印本页"
 onclick="factory.printing.Print(false)">
  <input id="idPrint2" type="button" value="页面设置"
 onclick="factory.printing.PageSetup()">
  <input id="idPrint3" type="button" value="打印预览"
 onclick="factory.printing.Preview()">
  <input id="idPrint4" type="button"
 onclick="window.close()" value="关闭窗口">
</div>
<br/>
<table width="720" border="0" cellspacing="0" cellpadding="0" align="center" >
  <tr> 
    <td  bgcolor="#0099ff">
   这里是你要打印的内容,上面的按钮不会被打印出来<br/>
   factory.printing.paperSize = "A3"
   </td>
</tr></table></body>

解决方案 »

  1.   

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

  2.   

    感觉不错.但试了,,,它说没有注册 WScript ?? 如何做呢?MSN:[email protected] thanksRegards小雪