rascal
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!
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.Applic ation");
oWord.Visible = true;
oWord.Documents.Open("<http://localhost/a.doc>", true);
oWord.Documents.Open("<http://localhost/b.doc>", true);
oWord.Documents.Item(1).Pr intOut(fal se);
oWord.Documents.Item(2).Pr intOut(fal se);
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!
<SCRIPT language = javascript >
function onclickbtn1()
{
var oWord;
oWord = new ActiveXObject("Word.Applic
oWord.Visible = true;
oWord.Documents.Open("<http://localhost/a.doc>",
oWord.Documents.Open("<http://localhost/b.doc>",
oWord.Documents.Item(1).Pr
oWord.Documents.Item(2).Pr
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 ??
Does anybody has solution ??
sgujjar,
this is a different problem, with a different solution, that deserves a different question.....
this is a different problem, with a different solution, that deserves a different question.....
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
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
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.Applic ation");
oWord.Visible = false;
oWord.Documents.Open(sFile name,false ,true);
oWord.Documents.Item(1).Pr intOut(fal se);
oWord.Documents.Close();
oWord.Quit();
oWord=null;
var oWord;
var sFilename=<place filename here>
oWord = new ActiveXObject("Word.Applic
oWord.Visible = false;
oWord.Documents.Open(sFile
oWord.Documents.Item(1).Pr
oWord.Documents.Close();
oWord.Quit();
oWord=null;
This code is really cool
2) Or you have to write an ActiveX control. Easiest in VB6 or Delphi.