I am working on CrystalReports for VS2005.I need to change the default printer to some other printer and no.of copies to 2 as compared to the default of 1.
I have succeeded to change the default printer using below code.
static int SetAsDefaultPrinter(string printerDevice)
{
int ret = 0;
try
{
string path = "win32_printer.DeviceId='" + printerDevice + "'";
using (ManagementObject printer = new ManagementObject(path))
{
ManagementBaseObject outParams =
printer.InvokeMethod("SetDefaultPrinter",
null, null);
ret = (int)(uint)outParams.Properties["ReturnValue"].Value;
}
}
How to change no. of copies.