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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting paper size fail in Datareport !

Status
Not open for further replies.

geneinf

Programmer
Mar 9, 2001
7
0
0
GT
I'm programming in VB6 over WinME, and have a printer Panasonic KX-P3626 matrix dot.

In my VB6 project I send continuos Checks to printer, but my select paper is Letter size.
Then I create a 2nd printer called "Printer Checks" with the same drivers that Panasonic, and I configure as default the User size to Wide: 850 and Large: 551 inches.

In my code I use the following lines to send my printing, looking for the 2nd printer with the User size defined, but for any reason it doesn't work:

'-----------------------------------------------------------------
If Predeterm_Printer("Printer Checks") = True Then
DataRepChk.PrintReport False, rptRangeAllPages
End If
'-----------------------------------------------------------------

In my .BAS module I have the Public function:

'-----------------------------------------------------------------
Public Function Predeterm_Printer(Impresora As String)
' Seek a Printer and assign as Default
Dim x As Printer
Dim Y As Boolean
Y = False

For Each x In Printers
If x.DeviceName = Impresora Then
' Set as default printer
Set Printer = x
' If found Stop and exit
Y = True
Exit For
End If
Next
If Printer.DeviceName <> Impresora Then MsgBox &quot;There isn't '&quot; & Impresora & &quot;' installed on your System!&quot;, vbCritical
Predeterm_Printer = Y
End Function
'-----------------------------------------------------------------

I need to solve this trouble. The other solution is selecting the User size on my 1st printer (without seek the 2nd printer) but I don't know how to do it !

Thank you very much
Email. geneinf@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top