主要是改变注册表里的HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup里的 margin_bottom、margin_top、margin_left、margin_right的几个值就可以改动页面的四个边距

解决方案 »

  1.   

    <script language="VBScript">
    pbottom= '下边距
    ptop=  '上边距
    pleft=  '左边距
    pright=  '右边距
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\margin_bottom"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,pbottom
    hkey_key="\margin_top"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,ptop
    hkey_key="\margin_left"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,pleft
    hkey_key="\margin_right"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,pright
    </script>
      

  2.   

    不好意思啊,漏了路径了
    <script language="VBScript">
    hkey_root="HKEY_CURRENT_USER"
    hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
    pbottom= '下边距
    ptop=  '上边距
    pleft=  '左边距
    pright=  '右边距
    Set RegWsh = CreateObject("WScript.Shell")
    hkey_key="\margin_bottom"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,pbottom
    hkey_key="\margin_top"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,ptop
    hkey_key="\margin_left"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,pleft
    hkey_key="\margin_right"
    RegWsh.RegWrite hkey_root+hkey_path+hkey_key,pright
    </script>
      

  3.   

    直接用css。@media print {
    body {font-size:9pt; margin:10px 20px 30px 40px }  
    }
      

  4.   

    感觉还是css可行, 想别人开ie就提示有修改注册表,很让人反感为病毒,呵, rising的功能..