I tried writing a code that will send a series of keystrokes to an external application
i have been trying for a long time to do this and finally was able to get it to this point by using this article i found on MSDN
here is the code i wrote
obviously i didn't do something right because when it is in my code area, each My.Computer.Keyboard.SendKeys() command is in red and it won't run
does anyone know what i can do to fix this?
i have been trying for a long time to do this and finally was able to get it to this point by using this article i found on MSDN
here is the code i wrote
Code:
Private Sub Command11_Click()
On Error GoTo Err_Command0_Click
DoCmd.OpenForm "Sketch"
My.Computer.Keyboard.SendKeys(^c ,wait)
DoCmd.Close acForm, "Sketch"
Dim stAppName As String
stAppName = "W:\Sketch.exe"
Call Shell(stAppName, 1)
My.Computer.Keyboard.SendKeys(% ,wait)
My.Computer.Keyboard.SendKeys({RIGHT})
My.Computer.Keyboard.SendKeys({RETURN} ,wait)
stAppName = "H:\set_click.exe"
Call Shell (stAppName,1)
My.Computer.Keyboard.SendKeys(^+{END})
My.Computer.Keyboard.SendKeys(^v)
My.Computer.Keyboard.SendKeys({TAB 6})
My.Computer.Keyboard.SendKeys({RETURN} ,wait)
My.Computer.Keyboard.SendKeys({RETURN} ,wait)
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command0_Click
End Sub
obviously i didn't do something right because when it is in my code area, each My.Computer.Keyboard.SendKeys() command is in red and it won't run
does anyone know what i can do to fix this?