Option Explicit
Private Const VK_END = &H23
Private Const VK_CONTROL = &H11
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Command1_Click()
With CommonDialog1
.ShowOpen
Dim strLine As String
Open .FileName For Input As #1
While Not EOF(1)
Line Input #1, strLine
Text1.Text = Text1.Text & strLine & vbCrLf
Wend
Close
Text1.SetFocus
'模拟Ctrl+End
keybd_event VK_CONTROL, 0, 0, 0
keybd_event VK_END, 0, 0, 0
keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_END, 0, KEYEVENTF_KEYUP, 0
End With
End Sub
[此贴子已经被作者于2006-12-22 10:47:28编辑过]