IADsPrintQueue Property: PrintDevices

Property Name
PrintDevices

Property Type
Variant

Description
Gets and sets an array of strings containing the names of the printer ports to which the print queue spools jobs.

For instance, "LPT1", "LPT2", "COM1", "COM2", "FILE" or "\\MOON\HP DeskJet 500C".

Example

Dim PrintQueue As IADsPrintQueue
Dim PrintDeviceArr As Variant
Dim PrintDevice As Variant
'Get the interface
Set PrintQueue = GetObject ("NTDS://MSFT/MOON/HP DeskJet 500C")
'Get PrintDevices
PrintDeviceArr = PrintQueue.PrintDevices
'Get each print device
For each PrintDevice in PrintDeviceArr
  Debug.Print PrintDevice
Next PrintDevice
'Set print devices
PrintQueue.PrintDevices = Array ("LPT1", "LPT2")
'Commit the changes
PrintQueue.SetInfo

 

See Also