-
Is it possible to find out what column cursor is in RTF? Word has that function so I guess it is possible. If you know something about it please let me know.
Thanks
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
-
Sure, first make the following declarations:
Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Const EM_LINEINDEX = &HBB
Then add the following function:
Private Function GetColumn(rtfBox As RichTextBox) As Long
Dim lngCharPos As Long
lngCharPos = SendMessage(rtfBox.hWnd, EM_LINEINDEX, rtfBox.GetLineFromChar(rtfBox.SelStart), 0&)
GetColumn = rtfBox.SelStart - lngCharPos
End Function
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
Thanks
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.