Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/03/2011, 12:57
Angeli
 
Fecha de Ingreso: abril-2008
Mensajes: 18
Antigüedad: 16 años
Puntos: 0
Respuesta: Impresión de una celda multilinea

Cita:
Iniciado por gasafonso Ver Mensaje
Una Forma que yo uso y esta buena, es con esta funcion el cual en "Qcontrol" es un textbox donde pones la cantidad de lineas que queres imprimir

Código vb:
Ver original
  1. Private Sub ImprimirPorLinea(qControl As TextBox)
  2.     Dim i As Long, k As Long
  3.     Dim L1 As Long, L2 As Long
  4.     Const EM_GETLINECOUNT = &HBA
  5.     Const EM_LINEFROMCHAR = &HC9
  6.     Const EM_LINELENGTH = &HC1
  7.     Const EM_LINEINDEX = &HBB
  8.  
  9.     ' Obtenemos el Número de líneas del TextBox
  10.    k = SendMessage(qControl.hwnd, EM_GETLINECOUNT, 0, 0&)
  11.    txtRenglones.text = k
  12.     Printer.Print ""
  13.     For i = k - Val(txtRenglones) To k - 1
  14.         L1 = SendMessage(qControl.hwnd, EM_LINEINDEX, i, 0&) + 1
  15.         L2 = SendMessage(qControl.hwnd, EM_LINELENGTH, L1, 0&)
  16.         Printer.Print Mid$(qControl.text, L1, L2)
  17.     Next
  18.     Printer.EndDoc
  19. End Sub


abrazo
Gracias Gasafonso, voy a probarlo. Angeli