Hello Guest it is April 20, 2024, 07:32:43 AM

Author Topic: VB Sendkeys  (Read 3799 times)

0 Members and 1 Guest are viewing this topic.

VB Sendkeys
« on: October 16, 2007, 04:39:06 PM »
hello everyone

I can open notepad from vb.
But sendkeys function explined in vb script manual does not seem to work.
nor[ b] appactivate[/b]
Anybody have exprience with this function?
 thans
john
Re: VB Sendkeys
« Reply #1 on: October 17, 2007, 08:51:02 PM »
How are you using the sendkeys? I have found several commands don't work correctly unless they are part of a SUB.

In a mach button script you often need this structure:

Sub Main
commands here
End Sub

Main

This creates a subroutine, then calls it. I just had a file open problme I fixed today and changing to this structure fixed it.

Dont ask me why this works, but it does.
Re: VB Sendkeys
« Reply #2 on: November 14, 2007, 02:44:48 AM »
I, myself, am having trouble with the SendKeys command. My problem may be because I am attempting to apply the key function to another application, and I am unsure as to whether I need to call the other application to focus first. I will let you know if I learn anything.