Forum Moderators: open
Does anyone know if it's possible to assign a action to a link so when clicked the target page/document, in this case a Word doc, prints without opening (or opens - prints - then closes automatically) There is no worry of users not having access to word 2000 because this is a problem with our intranet.
Maybe Jscript?
Ta
Limbo
I haven't tried it, but I think the following should work (given that it sounds like your environment is a Microsoft one, so your users have IE6+):
For each doc you wish to print, create a small html file (say file_to_print.html) with the following in the <head> section:
<link rel=alternate media=print href="file_to_print.doc">
and in the onload() function, call
window.print()and then close itself.
Then in your main html file, have the <a> tag open up file_to_print.html in a new window using 'target=...'
Depending on what you have on the server side, you may be able to make the solution more elegant (e.g. have a perl script create the small html file for you on the fly, so you don't have to create one for each doc to be printed).
There may be more elegant solutions, so I'd be interested in any other ideas.
Shawn
Prepare to enter the world of vbscript and the automation object...
If users have IE, you can use the same object model, automating it on the client with vbscript
[webmasterworld.com...]
I am sure I speak for everyone when I say sorry to hear that any of our responses made you feel out of depth. That was not the intent... quite the opposite. So, if any of our responses were too cryptic, please just ask for clarification of the bits that you felt uncomfortable about. We all get a kick out of helping someone solve a problem (and teaching and learning at the same time). We certainly don't get a kick out of making anyone feel out of depth.
Shawn
The combination of MS IE and MS Office offers some interesting possibilities, especially for intranet applications. The link aspdaddy gave should get you going.
It is possible to open and print a Word document automatically by clicking on a link, or even just by loading a page in the browser. You can even use the mailmerge-options of Word to print a letter with name and address info from the web page. But you don't want all that to happen when you're surfing the web, so MS has been so kind as to include some security barriers for this kind of scripting. You'll have to modify some settings in the users' browsers in order to get things working properly - which settings depends on the version of IE.
Hope this helps!