Calpi
|
PRESIDENTE PRUDENTE SP - BRASIL
|
|
ENUNCIADA !
|
|
|
Postada em 04/08/2008 22:00 hs
Peguei esta programação no forum. Imprime a linha certo, mas da coluna 0. Não consegui fazer imprimir da coluna que eu quero.
no form cole
Option Explicit Private Declare Function SendMessageAsString Lib "user32" Alias "SendMessageA" ( _ ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ ByVal lParam As String) As Long Private Declare Function SendMessageAsLong Lib "user32" Alias "SendMessageA" ( _ ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _ ByVal lParam As Long) As Long Private Const EM_GETLINE As Long = &HC4 Private Const EM_GETLINECOUNT As Long = &HBA
Private Function PegaLinhaContador(txt) As Long PegaLinhaContador = SendMessageAsLong(txt.hWnd, EM_GETLINECOUNT, 0, 0) End Function '// preenche o buffer com uma linha de texto definida em LinhaNumero '// a primeira linha comeco no zero Private Function PegaLinha(txt As TextBox, LinhaNumero As Long) As String '// caracteres por linha Const MAX_CHAR_PER_LINE As Long = 80 Dim ByteLo As Integer Dim ByteHi As Integer Dim rtn As Long Dim Buffer As String ByteLo = MAX_CHAR_PER_LINE And (255) ByteHi = Int(MAX_CHAR_PER_LINE / 256) Buffer = Chr$(ByteLo) + Chr$(ByteHi) + Space$(MAX_CHAR_PER_LINE - 2) rtn = SendMessageAsString(txt.hWnd, EM_GETLINE, LinhaNumero, Buffer) PegaLinha = Left$(Buffer, rtn) End Function
Preciso de uma luz. Obrigado.
|
|
|