Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/12/2008, 16:15
edovalle
 
Fecha de Ingreso: diciembre-2008
Mensajes: 1
Antigüedad: 15 años, 5 meses
Puntos: 0
De acuerdo Respuesta: Imprimir en Visual Basic

GLADYS TIENES EL CODIGO COMPLETO PARA IMPRIMIR LOS CHEQUES, YA QUE EL EJEMPLO, VEO QUE LO IMPRIMES CON EL VOUCHER DEL CHEQUE ME DA LA IMPRESION pero hay clase y una funcion que no estan ...

BUENO ES QUE NECESITO ALGO URGENTE ... saludos... CHILE

please aqui esta mi correo si me lees el post [email protected]

y veo que tienes el fuente...


Cita:
Iniciado por perezgladys28 Ver Mensaje
SI ES DIRECTAMENTE A LA IMPRESORA PUEDES HACERLO ASI:

ES UNA FUNCION Q VAS COLOCANDO LA POSICION DONDE QUIERES IMPRIMIR Y EL TIPO DE LETRA EL TAMAÑO, ETC..) IMPRIME SON LOS CONTROLES ACTUALES DE LA VENTANA D TU APLICACION

Private Function cmd_imprimir()
Dim Numeros As New clsNumeros

Printer.ForeColor = RGB(0, 0, 0)
Printer.FontSize = 8
'*** IMPRIMIR EL MONTO DE CHEQUE EN LETRAS
If IsNumeric(tmonto.Text) Then
Printer.CurrentX = 2900 'Posición horizontal
Printer.CurrentY = 2800 'Posición vertical
Printer.FontSize = 8
'Printer.Print Numeros.NroEnLetras(tmonto.Text)
Call justifica_printer2(2900, 9700, 2800, Numeros.NroEnLetras(tmonto.Text))
Else
MsgBox "Debe ingresar un numero.", vbInformation, "Atencion"
End If

On Error GoTo Control_Err

Printer.FontSize = 9 'El tamaño del texto

' ***MONTO DEL CHEQUE
Printer.CurrentX = 8700 'Posición horizontal
Printer.CurrentY = 1600 'Posición vertical
Printer.Print tmonto.Text

' **NOMBRE DE LA PÈRSONA
Printer.FontSize = 9
Printer.CurrentX = 2900 'Posición horizontal
Printer.CurrentY = 2400 'Posición vertical
Printer.Print tpers.Text

'*** OBSERVACION
Printer.FontSize = 8 'El tamaño del texto
'Printer.CurrentX = 2700 'Posición horizontal
'Printer.CurrentY = 7000 'Posición vertical
'Printer.Print tobservacion.Text
Call justifica_printer(2700, 8000, 7000, tobservacion.Text)

' ***MONTO DEL CHEQUE
Printer.FontSize = 10 'El tamaño del texto
Printer.CurrentX = 9500 'Posición horizontal
Printer.CurrentY = 7600 'Posición vertical5
Printer.Print tmonto.Text


'*** EL USUARIO

Printer.FontSize = 8 'El tamaño del texto
Printer.CurrentX = 1700 'Posición horizontal
Printer.CurrentY = 10800 'Posición vertical
Printer.Print tusu.Text

' ***NRO DE LA CUENTA

Printer.FontSize = 9 'El tamaño del texto
Printer.CurrentX = 2800 'Posición horizontal
Printer.CurrentY = 9800 'Posición vertical
Printer.Print tcuenta.Text

' ***fecha

Printer.FontSize = 10 'El tamaño del texto
Printer.CurrentX = 1700 'Posición horizontal
Printer.CurrentY = 3400 'Posición vertical
Printer.Print Day(tfecha.Text)

Printer.FontSize = 10 'El tamaño del texto
Printer.CurrentX = 2300 'Posición horizontal
Printer.CurrentY = 3400 'Posición vertical
Printer.Print "de"

mes = Month(tfecha.Text)
mesc = MonthName(mes)
Printer.FontSize = 10 'El tamaño del texto
Printer.CurrentX = 2900 'Posición horizontal
Printer.CurrentY = 3400 'Posición vertical
Printer.Print MonthName(mes)

Printer.FontSize = 10 'El tamaño del texto
Printer.CurrentX = 5080 'Posición horizontal
Printer.CurrentY = 3400 'Posición vertical
Printer.Print Year(tfecha.Text)


'** BANCO
Printer.FontSize = 8 'El tamaño del texto
Printer.CurrentX = 4400 'Posición horizontal
Printer.CurrentY = 9300 'Posición vertical
Printer.Print tban.Text


' *** NRO DEL CHEQUE
Printer.FontSize = 9 'El tamaño del texto
Printer.CurrentX = 2500 'Posición horizontal
Printer.CurrentY = 9300 'Posición vertical
Printer.Print tnrocheque.Text

' SI ES O NO ENDOSABLE
If tsi.Value = True Then
Printer.FontSize = 14 'El tamaño del texto
Printer.CurrentX = 5700 'Posición horizontal
Printer.CurrentY = 4400 'Posición vertical
Printer.Print "NO ENDOSABLE"
End If

End If

Printer.EndDoc

Control_Exit:
Exit Function

Control_Err:
MsgBox Err.Description, vbExclamation, "Error de sistema"
Resume Control_Exit

End Function

ESTA ES LA LLAMADA DE LA FUNCION Q ESTA EN EL CLIC DEL BOTON IMPRIMIR DE LA VENTANA:

Private Sub imprimir_Click()
If MsgBox("¿Desea imprimir?", vbYesNo + vbInformation, "Atención") = vbYes Then
Call cmd_imprimir
End If
End Sub

ESPERO Q T SIRVA