Private Const EM_LINEINDEX As Long = &HBB
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
'
Function GetRowCaret(ByRef oRtb As RichTextBox) As Long
GetRowCaret = oRtb.GetLineFromChar(oRtb.SelStart) + 1
End Function
Function GetColCaret(ByRef oRtb As RichTextBox) As Long
GetColCaret = oRtb.SelStart - SendMessage(oRtb.hwnd, EM_LINEINDEX, GetRowCaret - 1, ByVal 0&)
End Function