Computing.Net > Forums > Programming > SendKeys help (vba macro)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SendKeys help (vba macro)

Reply to Message Icon

Name: Tony
Date: September 2, 2003 at 12:09:15 Pacific
OS: win xp home
CPU/Ram: 1.8/256
Comment:

Hi.

I'd like to use sendkeys to send to notepad any keystrokes a user enters while in a smarterm session. However, all the examples of this function I have seen all seem to be for sending pre-determined text. Can it be used to send recorded keystrokes?

If not, is there any other way of coding this?

Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: September 2, 2003 at 19:55:49 Pacific
Reply:

You can send keystrokes, but it is highly inefficient and prone to error (and the target window HAS to be the top most window, so the terminal could not be active while the sendkey command was executing.)

A better way is to use the metafile functions from the win32 api (if you want to record everything that happens), otherwise, you could simply write the keystrokes to a file.

Hope this helps some,
Chi Happens


0

Response Number 2
Name: Tony 48
Date: September 3, 2003 at 10:25:17 Pacific
Reply:

Thanks for the comments. I know you don't advise the sendkey method, but do you know what I would need to do to try it? What I mean is what do I type instead of a string for the first argument?


0

Response Number 3
Name: Chi Happens
Date: September 5, 2003 at 05:20:54 Pacific
Reply:

You would use a variable. This would contain the information you grabbed from the app that hosts the VBA run-time.

So something like (I don't have smartterm, so this should be considered psuedocode):

SendKeys SmartTerm.Terminal.Document.All

Chi Happens


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: SendKeys help (vba macro)

excel vba macro assistance www.computing.net/answers/programming/excel-vba-macro-assistance/10837.html

vba macro programming www.computing.net/answers/programming/vba-macro-programming/7594.html

VBA macro to average www.computing.net/answers/programming/vba-macro-to-average/15832.html