
Why doesn't this code work on win 2000
Private Function AddnewPrinter() As String
Dim Retval As Long
Dim pi2 As PRINTER_INFO_2
AddnewPrinter = ""
pi2.pPrinterName = "OSCAR CWB PRINTER"
pi2.pPortName = "LPT1:"
pi2.pDriverName = "IBM Proprinter XL II"
pi2.pPrintProcessor = "WinPrint"
pi2.pDatatype = "RAW" '"RAW" for NT;"EMF" for 95
Retval = AddPrinter(vbNullString, 2, pi2)
If Retval <> 0 Then AddnewPrinter = "OSCAR CWB PRINTER"
End Function
Anybody can help.
Phuong