Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get default printer (xp, vista)

Status
Not open for further replies.

jozino01

Technical User
Apr 25, 2003
257
CA
hi,
i am looking for a sample code how to detect default printer in xp/vista.
i have a code for printing into pdf file using bullzip and cannot figure out how to set back original default printer.
thanks.
 
thanks, I got it working with this simple code:

Private Declare Function GetProfileString Lib "kernel32.dll" Alias "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long
...
Dim OldPrinter As String
Dim objPrinter As Printer
Set objPrinter = GetDefaultPrinter()
OldPrinter = objPrinter.DeviceName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top