BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Dim excel As Microsoft.Office.Interop.Excel.Applicationexcel = New Microsoft.Office.Interop.Excel.Applicationexcel.ActivePrinter = _DEFAULT_ID_PRINTERwb.Activate()wb.Save()
[DllImport("Winspool.drv")]
private static extern bool SetDefaultPrinter(string printerName);
static void Main(string[] args)
{
// Change the default printer to XPS Document Writer
SetDefaultPrinter("Microsoft XPS Document Writer");
//Print an Excel document
System.Diagnostics.Process pr = new System.Diagnostics.Process();
pr.StartInfo.Verb = "Print";
pr.StartInfo.FileName = "Sample.xls";
pr.Start();
} |