Export (0) Print
Expand All

PrintServer.GetPrintQueues Method (EnumeratedPrintQueueTypes())

Gets the collection of print queues of the specified types that are named in EnumeratedPrintQueueTypes and hosted by the print server.

Namespace:  System.Printing
Assembly:  System.Printing (in System.Printing.dll)

Public Function GetPrintQueues ( _
	enumerationFlag As EnumeratedPrintQueueTypes() _
) As PrintQueueCollection


Type: System.Printing.EnumeratedPrintQueueTypes()

An array of values that represent the types of print queues that are in the collection.

Return Value

Type: System.Printing.PrintQueueCollection
The PrintQueueCollection of print queues, of the specified types, on the print server.

The following example shows how to use this method to get a subset of available print queues.

			' Specify that the list will contain only the print queues that are installed as local and are shared
			Dim enumerationFlags() As EnumeratedPrintQueueTypes = {EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Shared}

			Dim printServer As New LocalPrintServer()

			'Use the enumerationFlags to filter out unwanted print queues
			Dim printQueuesOnLocalServer As PrintQueueCollection = printServer.GetPrintQueues(enumerationFlags)

			Console.WriteLine("These are your shared, local print queues:" & vbLf & vbLf)

			For Each printer As PrintQueue In printQueuesOnLocalServer
				Console.WriteLine(vbTab & "The shared printer " & printer.Name & " is located at " & printer.Location & vbLf)
			Next printer
			Console.WriteLine("Press enter to continue.")

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft