Hi all,

i have a link that opens .doc files, .docx files, csv files or .xls or .xlsx files. i want silent printing of these files. Only one file opens at a time.

If silent printing is not possible then atleast print dialog box should open up along with the file. i am trying to implement this using javascript.

<script>
var w=new ActiveXObject('Word.Application'); 

var obj;
if (w != null)
{
w.Visible = true;
obj=w.Documents.Open("d:\\2.5\\test.docx"); 
var docum = obj.value;
w.Documents.Save();
w.Quit();
}

</script>

this script opens the document. but i am not able to open print dialog box on it.

thanks,

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Windows (vers 25 March 2009), see www.w3.org">
    <script type="text/javascript">

    var w=new ActiveXObject('Word.Application'); 

    if (w){
      w.Visible = true;
      w.Documents.Open("d:\\2.5\\test.docx"); 
      w.ActiveDocument.PrintOut();
      w.Quit();
    }

    </script>
    <title></title>
  </head>
  <body>
  </body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.