none
Unique Network Printer Name RRS feed

  • Question

  • I am trying to retrieve the Network Printer name using ThisAddIn.Application.ActivePrinter

    But on different systems this property has different values for the same printer.

    Like on my system it retrieves "Xerox 54658 (12-17)" and on a different machine the ActivePrinter property retrieves "12-17".

    Is there a way to uniquely retrieve the network printer name ??

    I also tried, but have the same problem

                List<string> printerList = new List<string>();

                ObjectQuery query = new ObjectQuery("Select * From Win32_Printer");

                ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);

                foreach (ManagementObject mo in searcher.Get())
                {
                    foreach (PropertyData property in mo.Properties)
                    {
                        if (property.Name == "DriverName")
                        {
                           // printerList.Add(property.Value.ToString());
                        }
                    }
                }

    Friday, September 28, 2012 5:24 PM

Answers

All replies