Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

Printer Status using it as a variable, if x then y

$
0
0
I am trying to get get the status of a specific printer stored as a variable so something happens when it is printer, or idling, etc. I am able to retrieve the status of all the printer connected to my PC(see code below). How to I set the status of a Pinter as a variable?

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Dim strPrintServer As String, WMIObject As String, PrinterSet As Object, Printer As Object

strPrintServer = "localhost"
WMIObject = "winmgmts://" & strPrintServer
PrinterSet = GetObject(WMIObject).InstancesOf("win32_Printer")

For Each Printer In PrinterSet
MsgBox(Printer.Name & ": " & (Printer.PrinterStatus))
Next Printer
End Class

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>