standard printer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello ng,

can you help me?

how i can find out:
which printer ist the standard printer?

have you a code example ?

Thanks for your help.
greetings fromm good old germany

klaus

ps.: sorry for my miserable english
 
Hi Klaus ! :O)

Add a reference to System.Management.dll :
'***
Option Explicit On

Imports System.management

Module MainModule

Public Sub Main()
Console.WriteLine(GetDefaultPrinter())
End Sub

Private Function GetDefaultPrinter() As String

Dim mos As ManagementObjectSearcher = New
ManagementObjectSearcher( _
"select Name from Win32_Printer where Default = TRUE")

For Each mo As ManagementObject In mos.Get()
Return DirectCast(mo("Name"), String)
Next

Return String.Empty

End Function

End Module
'***
 
Hello,

can you tell me,
how it works with windows 2000 professional?
thanks & bye

Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top