Link to home
Start Free TrialLog in
Avatar of rascal
rascalFlag for United States of America

asked on

How to print multiple MS WORD docs from browser

My current ASP app http links to a single MS Word doc so that when users click on the doc link, the document is opened via their local copy of MS WORD. From there, they can press their PRINT button from within Word to print the document.

However, I would like to be able to provide a link that would automatically print several word docs on the user's printer without requiring them to open each doc individually and press the Print button. Is this possible?

It is for a secure internal intranet, everyone using the latest IE and everyone having MS Word on their machines.

3rd party controls are also acceptable if this is the only way. Is there a Windows Scripting Host procedure that can be used? Javascript?

Thanks for any help!

Avatar of rolftollerud
rolftollerud

1) If you are on an Intranet, maybe it possible to let the server write out on your local computer!
2) Or you have to write an ActiveX control. Easiest in VB6 or Delphi.
ASKER CERTIFIED SOLUTION
Avatar of Shalom Carmel
Shalom Carmel
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rascal

ASKER

Thanks for the great response shalomc. I wanted to share another suggestion I received via a newsgroup:

<SCRIPT language = javascript > 
function onclickbtn1()
{
        var oWord;
        oWord = new ActiveXObject("Word.Application");
        oWord.Visible = true;
        oWord.Documents.Open("<http://localhost/a.doc>",true);
        oWord.Documents.Open("<http://localhost/b.doc>",true);
        oWord.Documents.Item(1).PrintOut(false);
        oWord.Documents.Item(2).PrintOut(false);
        oWord.Quit();
}
</SCRIPT>

The above script is nice since it doesn't require any user interaction. In my case, it is ideal since I will be sending up to 30 or more documents to the printer and don't want to have the user have to press the print confirmation dialog that appears as a result of your sample code. This sample does however require that the user's browser setting for ActiveX controls and plug-ins (Initialize and script ActiveX controls not marked as safe) be set to at least 'prompt' for their Intranet zone, but this is acceptable to the customer.

Again thanks for your expertise!
I am facing a similar problem. I have list of documents on server and i want to allow user to select them and on hit of a print button, i want all the docs to be printed without any furhter intervention .

Does anybody has solution ??
sgujjar,
this is a different problem, with a different solution, that deserves a different question.....
Avatar of rascal

ASKER

Doesn't the above (my comment dated 8/20/03) meet your needs?
It is. But i want to avoid those word dialog box and windows print dialog box.

I may have each user on my site print approx 20 docs daily and it is very annoying to respond 20 + 20 dialogs to print them

Avatar of rascal

ASKER

I don't get any such popups. Here is my actual production code:

var oWord;
var sFilename=<place filename here>

oWord = new ActiveXObject("Word.Application");
oWord.Visible = false;
oWord.Documents.Open(sFilename,false,true);
oWord.Documents.Item(1).PrintOut(false);
oWord.Documents.Close();
oWord.Quit();
oWord=null;
This code is really cool