在 onafterprint 事件里再次调用打印, 打印新的文件即可

解决方案 »

  1.   

    没有测试过, 你自己再调试一下:
    var a = new Array();
    a[0] = "a.htm";
    a[1] = "b.htm";
    a[2] = "c.htm";
    var global = 0;function hehe()
    {
      if(global>=a.length) return;
      var newWin = window.open(a[global], "_blank");
      newWin.document.body.insertAdjacentHTML("beforeEnd", "<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0><\/OBJECT>");
      newWin.onafterprint = function()
      {
        window.opener.hehe();
        newWin.close();
      }
      global++;
      newWin.document.all.WebBrowser.ExecWB(6,6); //直接打印
    }
    hehe();