VB Code:
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 WM_KEYDOWN = &H100
Private Const WM_KEYUP = &H101
Private Const VK_LEFT = &H25
Private Const VK_UP = &H26
Private Const VK_RIGHT = &H27
Private Const VK_DOWN = &H28
Private Sub Command1_Click()
' Assuming lhWnd is the handle of the edit box or whatever
SendMessage lhWnd, WM_KEYDOWN, VK_LEFT, 1&
SendMessage lhWnd, WM_KEYUP, VK_LEFT, 1&
End Sub
There's also a