Reputation: 205
I am trying to send a page down keypress using VBA.
Set Myscreen = Sys.Screen, SYS is set as Set Sys = GetObject("C:\Program Files\Attachmate\E!E2K\Sessions\AS400-A.EDP")
I tried;
Myscreen.SendKeys "{PGDN}"
Myscreen.SendKeys ("{PGDN}")
Myscreen.SendKeys ("<PGDN>")
Myscreen.SendKeys "{PAGE DOWN}"
Myscreen.SendKeys ("{PAGE DOWN}")
Myscreen.SendKeys ("<PAGE DOWN>")
Myscreen.SendKeys "{PAGE DN}"
Myscreen.SendKeys ("{PAGE DN}")
Myscreen.SendKeys ("<PAGE DN>")
Myscreen.SendKeys "{Down}"
Myscreen.SendKeys ("{Down}")
Myscreen.SendKeys ("<Down>") - this was the only that did anything, it moved the cursor down a line.
I got delete to work using Myscreen.Sendkeys ("<DELETE>")
.
Upvotes: -1
Views: 12445
Reputation: 12499
The correct Syntax for {Page Down} should be
Option Explicit
Sub sndkey()
'// to send multiple times try "{PGDN 5}"
Application.SendKeys "{PGDN}"
End Sub
look at MSDN & SendKeys Class
Edit
okay I have tested it works
Option Explicit
Sub sndkey()
Dim Myscreen As Object
Set Myscreen = Sys.Screen
'// to send multiple times try "{PGDN 5}"
Myscreen.SendKeys "{PGDN 6}"
End Sub
Upvotes: 0