How to get the print queue Document's count in Do.Net 1.1?

With WMI and Win32_PrintJob class this is easy:
VB.NET:
Dim searcher As New ManagementObjectSearcher("root\CIMV2", "SELECT * FROM Win32_PrintJob")
Dim printJobsQueued As Integer = searcher.Get.Count
This will get the number of print jobs in queue for all printers installed on machine.

To use WMI you must Add Reference to .Net library System.Management.dll and you could import the namespace (Imports System.Management)
 
Back
Top