Just so that Serge doesn't get too many Post Counts...
Code:
For i = 0 To dblCount - 1
'Allow operating system to procces other events
DoEvents
'MY CODE, NOT SERGE'S, MINE
ProgressBar1.Value = cint(i/dblCount * 100)
'Get line index
dblLineIndex = SendMessage(.hwnd, EM_LINEINDEX, i, 0)
'get line length
dblLength = SendMessage(.hwnd, EM_LINELENGTH, dblLineIndex, 0)
'resize buffer
strBuffer = Space(dblLength)
'get line text
Call SendMessageStr(.hwnd, EM_GETLINE, i, ByVal strBuffer)
'append "V" at the beginning of the line
strRichText = strRichText & "V " & strBuffer & vbCrLf
Next
'rewrite text in RichTextBox
.Text = strRichText