-
Apr 15th, 2008, 06:47 AM
#1
Thread Starter
Member
[VB6] SendKey Pressing ENter?
Im using
Code:
Sub Sendkey(text$, Optional wait As Boolean = False)
'wrapper for Sendkeys which does not crash in the IDE under Windows Vista
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys text, wait
Set WshShell = Nothing
End Sub
and
and so far, it's working. All I want to know, is by using the code provided, how is it possible to send the 'return' key... AKA the 'enter' key.
Ive tried "{RETURN}", but got an error... Any idea's?
Thanks.
EDIT: Thanks anyway guys, but ive got it, and for future reference, it's
-
Apr 15th, 2008, 07:07 AM
#2
Re: [VB6] SendKey Pressing ENter?
If a post has been helpful please rate it.
If your question has been answered, pull down the tread tools and mark it as resolved.
-
Apr 15th, 2008, 08:49 AM
#3
Frenzied Member
Re: [VB6] SendKey Pressing ENter?
Or:
Works most of the time.
-
Sep 30th, 2008, 09:46 AM
#4
Member
Re: [VB6] SendKey Pressing ENter?
Hi. I didn't get this to work and I really want it to work! Help?
I saw this program on youtube, but the person who made it did it in a text document! I want to make it in VB6 but the commands he used don't seem to work. I have also tried the things in this thread but they don't seem to work either.
I have a text box that changes X:
Code:
for i = 1 to X
sendkey text2.text
sendkey "{enter}"
next i
What am I doing wrong? Do I need all those "wshshell.blabla" for it to work? If so how do I get it working?
Please give me the full code so that I can copy and paste, thanks.
-
Sep 30th, 2008, 11:26 AM
#5
Frenzied Member
Re: [VB6] SendKey Pressing ENter?
Code:
x = Val(Text2.Text)
Text2.SelStart = Len(Text2.Text)
For i = 1 To x
SendKeys "{enter}"
Next
-
Sep 30th, 2008, 11:26 AM
#6
Addicted Member
Re: [VB6] SendKey Pressing ENter?
As far as I know you only need the wrapper things in Vista.
-
Oct 1st, 2008, 04:46 AM
#7
Member
Re: [VB6] SendKey Pressing ENter?
It's okay I got it working on my own.
Code:
for i = 1 to text1.text
Sendkeys text2.text and "{enter}"
next i
-
Oct 7th, 2008, 08:15 AM
#8
Member
Re: [VB6] SendKey Pressing ENter?
Okay now I need to know how to make it push "Windows" and "E" at the same time.
You know, the little picture of the Flag in between CTRL and ALT.
If you hold the flag and push ""E, "My Computer" will open.
Please give me the Sendkeys command for pushing Windows and "E" at the same time.
Thanks
EDIT:
How about typing all the names for these buttons: (Or a link to a place where I can find this)
Windows flag?
Control?
Alt?
F1 - F12?
Tab?
Shift?
Arrow keys?
Last edited by Divran; Oct 7th, 2008 at 08:19 AM.
-
Sep 17th, 2009, 05:39 AM
#9
Fanatic Member
Re: [VB6] SendKey Pressing ENter?
-
Sep 17th, 2009, 07:36 AM
#10
Re: [VB6] SendKey Pressing ENter?
from msdn
To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes:
Key Code
SHIFT +
CTRL ^
ALT %
To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".
To specify repeating keys, use the form {key number}. You must put a space between key and number. For example, {LEFT 42} means press the LEFT ARROW key 42 times; {h 10} means press H 10 times.
TAB {TAB}
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 18th, 2009, 03:17 AM
#11
Fanatic Member
Re: [VB6] SendKey Pressing ENter?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|