我试了,还是不行,我的网页是通过window.open得到的。

解决方案 »

  1.   

    WebBrowser.ExecWB(1,1) 打开Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口Web.ExecWB(4,1) 保存网页Web.ExecWB(6,1) 打印Web.ExecWB(7,1) 打印预览Web.ExecWB(8,1) 打印页面设置Web.ExecWB(10,1) 查看页面属性Web.ExecWB(15,1) 好像是撤销,有待确认Web.ExecWB(17,1) 全选Web.ExecWB(22,1) 刷新Web.ExecWB(45,1) 关闭窗体无提示
      

  2.   

    <html>
    <head>
    <title></title>
    <script language="javascript">
       function printsetup()
       {
       //打印页面设置
         wb.execwb(8,1);
       }
       function printpreview()
       {
       //打印页面预览
          wb.execwb(7,1);
        }
       function printit()
       {
          if (confirm('确定打印吗?')) 
           {
     wb.execwb(6,1)
    }
        }
    </script><script language=javascript>
      //浮动帧打印
      function fudong() 
      {
       var odoc=window.document;
       var r=odoc.body.createTextRange();
       var stxt=r.htmlText;
       alert(stxt)
       var pwin=window.open("","print");
       pwin.document.write(stxt);
       pwin.print();
      }
    </script><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>
      

  3.   

    self.opener.opener=null;  //or  self.opener=null;       self.opener.close();self.close();
      

  4.   

    Web.ExecWB(45,1) 关闭窗体无提示
    self.opener.close();
      

  5.   

    我试过,发现
    res://C:\WINNT\system32\shdoclc.dll/preview.dlg 出错:
    'dialogArguments.__IE__PrintType' 为空或不是对象
    //-------------------------------
    up
      

  6.   

    function printpreview()

       // 打印页面预览
    try
    {
    wb.ExecWB(7,2);
    window.onfocus=function(){wb.ExecWB(45,1);}
    window.opener=null;
    }
    catch(e)
    {
    window.close();
    }
    try{
    window.close();
    }
    catch(e)
    {
    window.close();
    }
    }