user1787114
user1787114

Reputation: 205

How to apply Sendkeys Page Down?

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

Answers (2)

arkangelsk
arkangelsk

Reputation: 1

this is the correct syntax Myscreen.SendKeys ("<rollup>")

Upvotes: -1

0m3r
0m3r

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

Related Questions