Process.Start suppress print dialog box

G

Guest

I am trying the print an html document using Process.Start with the verb
"print", which works except it displays the print dialog box. The printer is
set correctly to the one specified using the .Arguments property, so I know
the printer name is correct. Internet Explorer is the associated
application. Any ideas on how to suppress the print dialog box?


ProcessStartInfo psi = new ProcessStartInfo(m_strFilenameToPrint);
Process p = new Process();

psi.Verb = "print";
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.Arguments = m_strPrinterName;
psi.CreateNoWindow = true;
psi.UseShellExecute = true;

p.StartInfo = psi;
p.EnableRaisingEvents = true;
p.Start();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top