Why doesn't this code work on win 2000 
Author Message
 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



Sun, 13 Mar 2005 23:30:17 GMT  
 Why doesn't this code work on win 2000
This may be a dumb reply.  Are you sure you're logged on as Aministrator
when you run this code?  In my experience, Win2000 machines only allow local
administrators to install printers.

Anny Mueller


Quote:
> 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



Sun, 20 Mar 2005 02:05:07 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Win 2000 Offline files doesn't work with mdb

2. GetOpenFileName32 doesn't work under Win 2000

3. Code doesn't work on windows 2000

4. Code doesn't work, why?

5. why this code doesn't work?

6. Why doesn't these codes work?

7. Validate Code - Why doesn't this work!?

8. why doesn't this code work?

9. why this code doesn't work??

10. Why doesn't this simple code work!!!!

11. Why doesn't this code work?

12. Why this code doesn't work?

 

 
Powered by phpBB® Forum Software