Holy crap, that actually worked, thx Steven you rock. This helps me solve a
lot of printing issue's! thx a lot :D
Richard
"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> schreef in bericht
news:w0UzheEdEHA.1520@cpmsftngxa10.phx.gbl...[color=blue]
> Hi Richard,
>
> From your description, you output a Word Document to the client user in a
> certain web page's response stream. And you found you're unable to use
> window.print() script code to print the page now, yes?
>
> As for this problem, it is because when you render out a page as a word
> document, the contenttype is changed to "application/msword" rather than
> the standard "text/html" , so there is no html also script code in the
> response content. And we can't call the script code to print the page from
> itself. However, I think we can use another means to workaround this, we
> can define a container page which contains a <iframe > element (set width
> and height to 100%) , and set the iframe's src attribute to the page which
> return the Word document. Then, we can use script code in the container
> page to print the iframe page(which is host the word document). For
> example, in the container page we define the following iframe:
>
> <iframe id="innerFrame" src="worddoc.aspx"/>
>
> Then, we can provide the following script function:
> function printInnerDoc()
> {
> window.frames[0].print();
> }
>
> And use it in the container page's onload event, such as
> <body onload="printInnerDoc()">
>
> Please have a try and if you have any other ideas, please also feel free
> to post here. Thanks.
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure!
www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
>
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
>[/color]