How to change default printer using c#.net?


A

Andrew

Hello, friends,

We need to programmatically change default printer in our c#.net 2005
application. We tried:

System.Drawing.Printing.PrinterSettings oPS = new
System.Drawing.Printing.PrinterSettings();

try
{
oPS.PrinterName = defaultPrinterName;
}
catch (System.Drawing.Printing.InvalidPrinterException ix)
{
Console.WriteLine(ix.Message);
return false;
}
finally
{
oPS = null;
}

but, no luck. The thrid party applications, say MS Word/NotePad, still use
previous default printer, not the new specified one.

Any ideas? Thanks a lot.
 
Ad

Advertisements

Ad

Advertisements

P

peshave.sayali

Hi,
Please tell me how to set programmatically default printer to undefault?
 

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

Similar Threads


Top