Function GetDefaultPrinter() As String
Dim strDefault As String
Dim lngbuf As Long
strDefault = String(255, Chr(0))
lngbuf = GetProfileString("Windows", "Device", "", strDefault, Len(strDefault))
If lngbuf > 0 Then
GetDefaultPrinter = Left$(strDefault, InStr(strDefault, ",") - 1)
Else
GetDefaultPrinter = ""
End If
End Function