Bonjour,
J'ai un programme qui imprime plusieurs documents. Soint un par un, soit tous d'un coup. L'impression tous d'un coup, marche si j'utilise window.print() mais si j'utilise WebBrowser.ExecWB(6,6). Seul le premier document est imprimé?
Voici le code source . Fichiers principal des boutons :
<HTML>
<HEADER>
<TITLE>Test Impression</TITLE>
</HEADER>
Choisissez le document à imprimer:
<FORM name="Document1">
<INPUT type="button" name="Doc1" style="width:150px" value="Doc1" onClick="
fenetre1=window.open('exempl1.html','exempl1');
">
</FORM>
<FORM name="Document2">
<INPUT type="button" name="Doc2" style="width:150px" value="Doc2" onClick="
fenetre=window.open('exempl2.html','exempl2');
">
</FORM>
<FORM name="Document3">
<INPUT type="button" name="Doc3" style="width:150px" value="Doc3" onClick="
fenetre3=window.open('exempl3.html','exempl3');
fenetre3.blur();
fenetre3.print();">
</FORM>
<FORM name="PrintAll">
<INPUT type="button" name="PrintAll" style="width:150px" value="PrintAll" onClick="
fenetre1=window.open('exemple1.html','exemple1');
">
</FORM>
</BODY>
</HTML>
FIchier exemple1 , qui lance l'impression du premier document et ouvre le document2, qui a son tour , s'imprimera et lancera le doc3.
<!-- saved from url=(0022)http://internet.e-mail -->
<html>
<head>
<link rel=alternate media=print href="c:\doc1.doc">
<script id=clientEventHandlersJS language=javascript>
<!--
function TraitementFenetre() {
window.setTimeout('window.close()',3000);
window.blur();
window.print();
window.open("exemple2.html");
}
function Button1_onclick() {
WebBrowser.ExecWB(6,6);
}
//-->
</script>
</head>
<body>
<body onload="TraitementFenetre();" >
<OBJECT ID="WebBrowser" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>
Test D'impression<br>
</body>
</html>
Merci