There is no such command as SelUndo on a RichTextBox what are you trying to do?
You didn't even try my suggestion before coming back here.
The RichTextBox can be told to undo, but it only remembers the last thing that happened to it. I.e. you cannot under more than once.
It is supposed to support multi-level undo, but it really doesn't.
To send it the message, you will need to declare the following functions and enumerations. You should probably do this in a seperate file (add a module)
CODE
Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const WM_USER = &H400
Public Const EM_UNDO = &HC7
Public Const EM_REDO = (WM_USER + 84)
Then to tell it to undo/redo:
CODE
Public Sub Undo()
SendMessageLong rtfText.hwnd, EM_UNDO, 0, 0
End Sub
Public Sub Redo()
SendMessageLong rtfText.hwnd, EM_REDO, 0, 0
End Sub
The first time you do Undo, it will undo, but the second time, it will actually do a Redo. So it really isn't that much use. There is a command you can send to it to tell it to have multiple levels of undo, but it doesn't work.
If you want to do that then you will have to do it the way I described in my first post.