Printer Driver = winspool, PLEASE HELP!

orange
07-18-2003, 10:01 PM
My developing environment is as follow:
Window 2000 Professional
Visual Basic 6.0 with service pact 5
Crystal Report 9.0


Here are part of my program for printing out the report

Dim prt As Printer

For Each prt In Printers
If prt.DeviceName = "HP LaserJet 4/4M Plus PS 600" Then
Set Printer = prt
Report.SelectPrinter prt.DriverName, prt.DeviceName, prt.Port
Exit For
End If
Next

Report.PrintOut

I am using the above codes to call the SelectPrinter function, but what I get for prt.DriverName is "winspool". Connection error occured as a result. Any idea how can I get the real name for my printer driver?

Please help!

KenChen
07-19-2003, 12:38 PM
Is your printer name "HP LaserJet 4/4M Plus PS 600" hard coded ?

why not retrieves the devices name from printers collection and let user to select.

Is this name "HP LaserJet 4/4M Plus PS 600" display on the printer folder

orange
07-20-2003, 12:02 AM
Yes, the printer name is on the printer folder.

I have to hard coded the printer name because when I close and re-open the connection for the report, the printer selected by the user is gone and it returns back to the setting by default.

set report = nothing
set report = crpApplication.OpenReport(App.path & "\a.rpt")

That's why I want the program to remember which printer was selected by the user and the users do not have to re-select their desired printer when they want to print the report again.

I need to solve this problem as soon as possible. Any help would be appreciated.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum