Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a Word doc via a button 1

Status
Not open for further replies.

lengoo

IS-IT--Management
Jan 15, 2002
381
GH
Hi All,
I have converted some Word docs into HTML in Word itself.. however, when people print, you don't quite get the correct formatting.. it's chopped on the right hand side.
So I was wondering if I can put a button on my web page to print either:
1) the original Word document with page selections
2) the HTML but reformatted so that it fits on the page

Does anyone have any idea on how I can do this using Javascript?
 
perhaps something like;

<script>
function fnPrint(s){
var win1 = window.open(s);
win1.print();
win1.close();
}
</script>
<a href=&quot;#&quot; onclick=&quot;fnPrint('mydoc.doc')&quot;>print</a>

--------------------------------------------------
- better than toast.
Penguins - better than --------------------------------------------------
 
You don't have to use a button if you don't want to. You can use CSS to override what the browser prints whether from a button click or from the file menu.

Put this in the head:
<link rel=alternate media=print href=&quot;printversion.doc&quot;>
 
Ah.. you guys make it look so easy.. thanks!!
 
What if I want to print more than one document per click? Is there a way to append several documents together or something to where my user clicks a button or link that reads 'Setup Packet' and then three seperate documents spit out the printer?

I currently have a webpage that lists all the files in a folder but my users say it is to difficult to click three seperate links.

Thanks In Advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top