SendKeys "{TAB ??}" 
Author Message
 SendKeys "{TAB ??}"

How is it possible to put a variable number in a sendkeys statement? ..
I have used loops, and selects they work fine, but take up a lot of code
is there an easier way? Thanks

Joe



Tue, 15 Jul 2003 07:46:49 GMT  
 SendKeys "{TAB ??}"

Quote:
> How is it possible to put a variable number in a sendkeys statement? ..
> I have used loops, and selects they work fine, but take up a lot of code
> is there an easier way? Thanks

If "num" = 5, then this should work (haven't tested it):

SendKeys "{TAB " & num & "}"

Thus, TAB would be sent 5 times.  Perhaps.  As stated, I haven't checked.

Regards, Otser.



Tue, 15 Jul 2003 07:50:36 GMT  
 SendKeys "{TAB ??}"
That did not work but it gave me an idea that did work!!  THANKS!!
:-)

Dim str1 as string, str2 as string, str3 as string
Dim MyNum as integer
MyNum = 5
str1 = "{right "
str2 = "}"
AppActivate "Untitled - Notepad"
SendKeys "1234567890", True
SendKeys "{home}", True
str3 = str1 + CStr(MyNum) + str2
SendKeys str3

Thanks Again!!

 Joe


Quote:

> > How is it possible to put a variable number in a sendkeys statement? ..
> > I have used loops, and selects they work fine, but take up a lot of code
> > is there an easier way? Thanks

> If "num" = 5, then this should work (haven't tested it):

> SendKeys "{TAB " & num & "}"

> Thus, TAB would be sent 5 times.  Perhaps.  As stated, I haven't checked.

> Regards, Otser.



Tue, 15 Jul 2003 08:06:56 GMT  
 SendKeys "{TAB ??}"
SendKeys "{right " + CStr(MyNum) + "}", True

also works great :-)


Quote:
> That did not work but it gave me an idea that did work!!  THANKS!!
> :-)

> Dim str1 as string, str2 as string, str3 as string
> Dim MyNum as integer
> MyNum = 5
> str1 = "{right "
> str2 = "}"
> AppActivate "Untitled - Notepad"
> SendKeys "1234567890", True
> SendKeys "{home}", True
> str3 = str1 + CStr(MyNum) + str2
> SendKeys str3

> Thanks Again!!

>  Joe




> > > How is it possible to put a variable number in a sendkeys statement?
..
> > > I have used loops, and selects they work fine, but take up a lot of
code
> > > is there an easier way? Thanks

> > If "num" = 5, then this should work (haven't tested it):

> > SendKeys "{TAB " & num & "}"

> > Thus, TAB would be sent 5 times.  Perhaps.  As stated, I haven't
checked.

> > Regards, Otser.



Tue, 15 Jul 2003 08:16:31 GMT  
 SendKeys "{TAB ??}"
Grab my PushKeys command from my website - it supports an enhanced SendKeys
syntax, which includes the ability to do just this. It also works with apps
that SendKeys won't work with - ie. DOS - and supports an inbuilt Sleep
command. It comes with a help file and full source.

Christopher Latta http://www.ozemail.com.au/~clatta
  In theory, there is no difference between theory and practice,
  but in practice there is a great deal of difference.

Quote:

>How is it possible to put a variable number in a sendkeys statement? ..
>I have used loops, and selects they work fine, but take up a lot of code



Wed, 16 Jul 2003 16:39:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. sendKeys("{Tab}") to another form

2. SendKeys "{tab}" doesn't work

3. SendKeys("{TAB}") catches depressed Shift-Key

4. sendkeys "^{TAB}", she no work!

5. sendkeys "+{TAB}"

6. sendkeys ("tab") on txtBox.maxlength

7. SendKeys "{TAB}"

8. SendKeys "{TAB}"

9. SendKeys "%({TAB})"

10. Why Does Sendkeys "TAB" NOT work

11. Need help using the "Sendkeys" command

12. Need help using the "Sendkeys" command

 

 
Powered by phpBB® Forum Software