While earlier answers correctly stated the new window must be from the same domain, they incorrectly answered why he got the error 'printwindow.document.body null or not defined'. It's because IE doesn't return any status from window.open() which means you can open a page and try to access it BEFORE onload is available.
For this reason you need to use something like setTimeout to check. For example:
printwindow = window.open('print.html');
var body;
function ieLoaded(){
body = printwindow.document.getElementsByTagName("body");
if(body[0]==null){
// Page isn't ready yet!
setTimeout(ieLoaded, 10);
}else{
// Here you can inject javascript if you like
var n = printwindow.document.createElement("script");
n.src = "injectableScript.js";
body.appendChild(n);
// Or you can just call your script as originally planned
printwindow.print();
}
}
ieLoaded();
This is further discussed here