title: Print html document from Windows Service without print dialog
body: <p>I am using a windows service and i want to print a .html page when the service will start. I am using this code and it's printing well. But a print dialog box come, how do i print without the print dialog box?</p>
  
  <pre><code>public void printdoc(string document)
  {
      Process printjob = new Process();
  
      printjob.StartInfo.FileName = document;
      printjob.StartInfo.UseShellExecute = true;
      printjob.StartInfo.Verb = "print";
      printjob.StartInfo.CreateNoWindow = true;
      printjob.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  
      printjob.Start();
  }
  </code></pre>
  
  <p>Have there any other way to print this without showing the print dialog box.</p>
  
  <hr>
  
  <p><strong>Update: in response to <a href="https://stackoverflow.com/questions/419412/print-html-document-from-windows-service-without-print-dialog/419427#419427">this</a>:</strong></p>
  
  <p>But i have already used this class but when i am calling the </p>
  
  <pre><code>axW.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER , ref em, ref em);
  </code></pre>
  
  <p>My program getting block here when i am using from window service but it is working fine from windows application.</p>