VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Easy SendKeys

by David (1 Submission)
Category: DDE
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

How to use ALT & Function Keys with the sendkey command

Inputs
1 Command Button Copy the code into the Command1_Click Event.
Assumes
Calculator is installed on the PC

Rate Easy SendKeys

Dim ReturnValue, I
ReturnValue = Shell("CALC.EXE", 1) ' Run Calculator.
AppActivate ReturnValue  ' Activate the Calculator.
For I = 1 To 100 ' Set up counting loop.
SendKeys I & "{+}", True ' Send keystrokes to Calculator
Next I ' to add each value of I.
SendKeys "=", True ' Get grand total.
SendKeys "%{F4}", True ' Send ALT+F4 to close Calculator.

Download this snippet    Add to My Saved Code

Easy SendKeys Comments

No comments have been posted about Easy SendKeys. Why not be the first to post a comment about Easy SendKeys.

Post your comment

Subject:
Message:
0/1000 characters