Visual Basic - posicionar text Multilinea al imprimir!

Life is soft - evento anual de software empresarial
 
Vista:

posicionar text Multilinea al imprimir!

Publicado por Germany (1 intervención) el 26/10/2006 23:44:55
Coloco el siguiente codigo para posicionar la impresion de un text multiline en cierta parte de la hoja

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
_____________________________________________________________
Private Sub ImprimirPorLinea(qControl As TextBox)
Dim i As Long, k As Long
Dim L1 As Long, L2 As Long
Const EM_GETLINECOUNT = &HBA
Const EM_LINEFROMCHAR = &HC9
Const EM_LINELENGTH = &HC1
Const EM_LINEINDEX = &HBB

k = SendMessage(qControl.hWnd, EM_GETLINECOUNT, 0, 0&)

Printer.Print ""
For i = 0 To k - 1
L1 = SendMessage(qControl.hWnd, EM_LINEINDEX, i, 0&) + 1
L2 = SendMessage(qControl.hWnd, EM_LINELENGTH, L1, 0&)
Printer.ScaleMode = 7
y = 3.1
Printer.CurrentY = y
y = y + 3.7

x = 3.2
Printer.CurrentX = x
x = x + 3.2

Printer.Print Mid$(qControl.Text, L1, L2)
Next
Printer.EndDoc
End Sub

El problema esta en que la segunda linea sale impresa en la primera linea del text ,multiline , es decir , una linea encima de otra! como puedo modificar esto ? cambie los varoles de y pero sucede lo mismo, muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder