点击这里给我发消息
点击这里给我发消息
¥1891.00元
智超淘宝店
设置选择的打印机
原创
文章标签 C# WinForm

Microsoft.Office.Interop.Excel.Application 设置选择的打印机

        //private string c_ExcelFile;
        private Microsoft.Office.Interop.Excel.Application c_Excel = null;
 c_Excel.ActivePrinter = _PrinterName;


            List m_PrinterList = new List();
            PrinterSettings m_PS = printDocument1.PrinterSettings;
            m_PrinterList.Add( m_PS.DefaultPageSettings.PrinterSettings.PrinterName);
            foreach (string  item in   PrinterSettings.InstalledPrinters)
            {
                m_PrinterList.Add(item);
            }